/* The food magazine article with the pronunciation that opens from the word: one page of a made-up food magazine,
   Larder, on warm paper. The sheet is drawn at one size (400 px wide) and .fit scales it to the window from the
   script, so the words always wrap the same way. GSAP moves the outer pieces (.say, .say__face rows, .w__tint,
   .w__prog, .syl); the CSS styles their children. */
:root {
  --bg: #ebe6de;            /* the table around the page */
  --paper: #fffcf7;         /* the page */
  --paper-under: #f4efe6;   /* the page underneath */
  --card: #fffefb;          /* the pronunciation card */
  --ink: #221e1a;           /* the words */
  --muted: #8b8278;         /* the small words */
  --accent: #b5502e;        /* the one accent: rouille, rust */
  --accent-soft: rgba(181, 80, 46, 0.12);
  --hair: rgba(60, 40, 20, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

html,
body {
  margin: 0;
  overflow: hidden;
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

p,
h1 {
  margin: 0;
}

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

.stage {
  position: relative;
  height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(80% 60% at 30% 12%, rgba(255, 252, 245, 0.85), transparent 70%),
    radial-gradient(70% 60% at 80% 100%, rgba(181, 80, 46, 0.06), transparent 70%),
    var(--bg);
}

.fit {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 400px;
}

.sheet-wrap {
  position: relative;
  opacity: 0;
}

/* the page underneath, peeking out at the bottom */
.sheet__under {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: -7px;
  height: 40px;
  border-radius: 0 0 14px 14px;
  background: var(--paper-under);
  box-shadow: 0 0 0 1px rgba(60, 40, 20, 0.06), 0 14px 26px -14px rgba(60, 40, 20, 0.3);
}

.sheet {
  position: relative;
  padding: 26px 30px 18px;
  border-radius: 14px;
  background: var(--paper);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 0 0 1px rgba(60, 40, 20, 0.07),
    0 2px 4px rgba(60, 40, 20, 0.04),
    0 14px 26px -10px rgba(60, 40, 20, 0.12),
    0 46px 80px -34px rgba(60, 40, 20, 0.32);
}

/* the grain of the paper */
.sheet::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0.32;
  mix-blend-mode: multiply;
  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='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .45  0 0 0 0 .35  0 0 0 0 .25  0 0 0 .32 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* a soft light that follows the pointer over the paper */
.sheet__sheen {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(260px 200px at var(--mx, 26%) var(--my, 18%), rgba(255, 255, 255, 0.7), transparent 70%);
}

.mast {
  position: relative;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.mast__logo {
  font-family: 'Newsreader Variable', Georgia, serif;
  font-style: italic;
  font-size: 23px;
  font-weight: 620;
  letter-spacing: -0.02em;
}

.mast__issue {
  font-size: 10.5px;
  font-weight: 520;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.mast__sep {
  margin: 0 3px;
}

.mast__rule {
  position: relative;
  display: block;
  height: 4px;
  margin: 9px 0 18px;
  border-top: 1px solid rgba(34, 30, 26, 0.7);
  border-bottom: 1px solid rgba(34, 30, 26, 0.16);
}

.kicker {
  position: relative;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.title {
  position: relative;
  margin: 7px 0 12px;
  font-family: 'Newsreader Variable', Georgia, serif;
  font-size: 31px;
  line-height: 1.04;
  font-weight: 480;
  letter-spacing: -0.025em;
  font-variation-settings: 'opsz' 60;
  text-wrap: balance;
}

.byline {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--muted);
}

.byline__face {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f1c9a8, #b5502e 70%, #7a3420);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.9), 0 1px 3px rgba(60, 40, 20, 0.25);
}

.byline__name {
  font-weight: 600;
  color: var(--ink);
}

.body {
  position: relative;
  margin-top: 18px;
}

.para {
  font-family: 'Newsreader Variable', Georgia, serif;
  font-size: 16.5px;
  line-height: 1.56;
  font-variation-settings: 'opsz' 16;
  color: var(--ink);
  transition: color 0.4s;
}

.body.is-quiet .para {
  color: rgba(34, 30, 26, 0.55);
}

.para--soft {
  margin-top: 10px;
  color: rgba(34, 30, 26, 0.5);
}

.body.is-quiet .para--soft {
  color: rgba(34, 30, 26, 0.32);
}

.drop {
  float: left;
  margin: 5px 1px 0 -1px;
  font-size: 54px;
  line-height: 0.82;
  font-weight: 520;
  font-variation-settings: 'opsz' 72;
  color: var(--accent);
}

/* a word you can hear */
.w {
  position: relative;
  display: inline-block;
  padding: 0 1px;
  line-height: 1.2;
  color: var(--ink);
  font-style: italic;
  vertical-align: baseline;
}

.w__txt {
  position: relative;
}

.w__tint {
  position: absolute;
  left: -4px;
  right: -3px;
  top: -1px;
  bottom: -2px;
  border-radius: 6px;
  background: var(--accent-soft);
  opacity: 0;
}

.w__line,
.w__prog {
  position: absolute;
  left: 1px;
  right: 13px;
  bottom: -1px;
  height: 1.5px;
}

.w__line {
  background: radial-gradient(circle, rgba(34, 30, 26, 0.45) 0.65px, transparent 0.9px) 0 50% / 3.2px 1.5px repeat-x;
}

.w__prog {
  border-radius: 1px;
  background: var(--accent);
}

.w__ico {
  position: relative;
  width: 10px;
  height: 10px;
  margin-left: 2px;
  vertical-align: 6px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.w__ico-box {
  fill: var(--accent-soft);
}

.w.is-heard .w__ico-box {
  fill: var(--accent);
}

.w.is-lit {
  z-index: 3;
}

.body.is-quiet .w.is-lit {
  color: var(--ink);
}

@media (hover: hover) {
  .w:hover .w__txt {
    color: var(--accent);
  }

  .speed__opt:hover {
    color: var(--ink);
  }
}

.foot {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--hair);
  font-size: 11px;
  color: var(--muted);
}

.foot__ico {
  width: 11px;
  height: 11px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.foot__heard {
  margin-left: auto;
  font-weight: 560;
  color: var(--ink);
}

/* figures that roll: two spans in a one-line window */
.roll {
  position: relative;
  display: inline-block;
  height: 1.2em;
  line-height: 1.2em;
  overflow: hidden;
  vertical-align: bottom;
}

.roll > span {
  display: block;
}

.roll > span + span {
  position: absolute;
  left: 0;
  top: 0;
}

/* ------------------------------------------------------------------ the pronunciation card */
.say {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 5;
  width: 300px;
}

.say__shadow {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -10px;
  height: 40px;
  border-radius: 50%;
  background: rgba(60, 30, 15, 0.22);
  filter: blur(16px);
}

.say__face {
  position: relative;
  padding: 13px 15px 13px;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff, var(--card) 40%, #fdf9f2);
  box-shadow:
    inset 0 1px 0 #ffffff,
    0 0 0 1px rgba(60, 40, 20, 0.09),
    0 1px 2px rgba(60, 40, 20, 0.06),
    0 8px 18px -6px rgba(60, 40, 20, 0.14),
    0 26px 48px -20px rgba(60, 40, 20, 0.28);
  overflow: hidden;
}

.say__face::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.22;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .45  0 0 0 0 .35  0 0 0 0 .25  0 0 0 .3 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.say__glint {
  position: absolute;
  top: -40%;
  left: -60%;
  width: 40%;
  height: 180%;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 236, 214, 0.75), transparent);
  transform: rotate(18deg);
  opacity: 0;
}

.say__glint-move {
  display: block;
}

.say__top {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.say__chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 8px 0 6px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 640;
  letter-spacing: 0.02em;
}

.say__chip svg {
  width: 11px;
  height: 11px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.say__lang {
  font-size: 10.5px;
  font-weight: 520;
  color: var(--muted);
}

.say__hw {
  position: relative;
  margin-top: 8px;
  font-family: 'Newsreader Variable', Georgia, serif;
  font-style: italic;
  font-size: 29px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-variation-settings: 'opsz' 48, 'wght' var(--w, 440);
}

.say__syl {
  position: relative;
  display: flex;
  align-items: flex-end;
  height: 30px;
  margin-top: 4px;
  gap: var(--gap, 5px);
}

.syl {
  position: relative;
  display: inline-block;
  padding-top: 8px;
  font-size: 15px;
  line-height: 18px;
  font-variation-settings: 'wght' var(--sw, 500), 'wdth' var(--sx, 100);
  color: var(--sc, #8b8278);
}

.syl__mark {
  position: absolute;
  left: 50%;
  top: 0;
  width: 7px;
  height: 7px;
  margin-left: -3.5px;
  overflow: visible;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
  stroke-linecap: round;
}

.syl__under {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 1.5px;
  border-radius: 1px;
  background: currentColor;
  transform-origin: 0 50%;
  opacity: 0.85;
}

.syl-dot {
  position: relative;
  display: inline-block;
  padding-bottom: 1px;
  font-size: 14px;
  line-height: 18px;
  color: rgba(34, 30, 26, 0.25);
}

.say__player {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 11px;
  padding: 8px 8px 8px 8px;
  border-radius: 14px;
  background: rgba(60, 40, 20, 0.035);
  box-shadow: inset 0 0 0 1px rgba(60, 40, 20, 0.05), inset 0 1px 2px rgba(60, 40, 20, 0.05);
}

.say__play {
  position: relative;
  flex: none;
  width: 36px;
  height: 36px;
}

.say__play-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 30%, #3a332c, var(--ink) 70%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 1px 2px rgba(34, 30, 26, 0.3), 0 6px 12px -4px rgba(34, 30, 26, 0.4);
}

.say__ring {
  position: absolute;
  inset: -4px;
  width: 44px;
  height: 44px;
  transform: rotate(-90deg);
  overflow: visible;
}

.say__ring-track {
  fill: none;
  stroke: rgba(60, 40, 20, 0.08);
  stroke-width: 1.4;
}

.say__ring-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.say__icon {
  position: relative;
  width: 15px;
  height: 15px;
  overflow: visible;
}

.say__tri {
  fill: #fffaf3;
  stroke: #fffaf3;
  stroke-width: 1;
  stroke-linejoin: round;
  transform-origin: 8px 8px;
}

.say__bars {
  fill: none;
  stroke: #fffaf3;
  stroke-width: 2.2;
  stroke-linecap: round;
  transform-origin: 8px 8px;
}

.say__wave {
  position: relative;
  flex: 1;
  height: 32px;
}

.wave {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wave i {
  display: block;
  width: 2.4px;
  border-radius: 2px;
}

.wave--base i {
  background: rgba(34, 30, 26, 0.2);
}

.wave--lit {
  clip-path: inset(-4px calc(100% - var(--p, 0%)) -4px 0);
}

.wave--lit i {
  background: linear-gradient(180deg, #d0704a, var(--accent));
}

.say__head {
  position: absolute;
  left: 0;
  top: -3px;
  bottom: -3px;
  width: 1.5px;
  margin-left: -0.75px;
  border-radius: 1px;
  background: var(--ink);
  opacity: 0;
}

.speed {
  position: relative;
  flex: none;
  display: flex;
  height: 26px;
  padding: 2px;
  border-radius: 13px;
  background: rgba(60, 40, 20, 0.06);
  box-shadow: inset 0 1px 1px rgba(60, 40, 20, 0.06);
}

.speed__thumb {
  position: absolute;
  left: 0;
  top: 2px;
  bottom: 2px;
  width: 30px;
  border-radius: 11px;
  background: #ffffff;
  box-shadow: 0 0 0 0.5px rgba(60, 40, 20, 0.1), 0 1px 2px rgba(60, 40, 20, 0.14), 0 3px 6px -2px rgba(60, 40, 20, 0.12);
}

.speed__opt {
  position: relative;
  padding: 0 7px;
  font-size: 10.5px;
  font-weight: 620;
  color: var(--muted);
  transition: color 0.3s;
}

.speed__opt.is-on {
  color: var(--ink);
}

.say__foot {
  position: relative;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.say__gloss {
  font-family: 'Newsreader Variable', Georgia, serif;
  font-size: 14px;
  line-height: 1.3;
  color: var(--ink);
}

.say__voice {
  flex: none;
  display: flex;
  gap: 6px;
  font-size: 10.5px;
  color: var(--muted);
}

.say__dur {
  font-weight: 600;
  color: var(--ink);
}

.say__notch {
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 11px;
  height: 11px;
  margin-left: -5.5px;
  background: #fdf9f2;
  box-shadow: 1px 1px 0 rgba(60, 40, 20, 0.09);
  transform: rotate(45deg);
}

.say.is-below .say__notch {
  top: -5px;
  bottom: auto;
  background: #ffffff;
  box-shadow: -1px -1px 0 rgba(60, 40, 20, 0.09);
}
