/* The calendar app headline whose day and time are menus: the opening of the landing page of Overlap, a made-up
   scheduling app, on a warm white page. The headline is set in Mona Sans with its weight and width axes driven by two
   custom properties (--w and --s) so GSAP can move them word by word; the two pills inside it are real buttons that
   open a floating menu. Below, the calendar preview holds the meeting that moves when the headline changes. */
:root {
  --page: #f4f2ee;          /* the warm white page */
  --paper: #ffffff;         /* the cards, the pills and the menu */
  --ink: #15151a;           /* the headline and the dark button */
  --muted: #85827b;         /* the small words */
  --line: rgba(21, 21, 26, 0.08); /* hairlines and edges */
  --accent: #4b4ae8;        /* the meeting, the chosen day, the light of the pills */
  --accent-2: #7b7cff;      /* the top of the meeting's gradient */
  --busy: #ecebe6;          /* the other meetings of the week */
  --free: #2f8a5f;          /* the word free in the menus */
}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

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

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

button {
  font: inherit;
  color: inherit;
}

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

.stage {
  position: relative;
  height: 100vh;
  min-height: 360px;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(10px, 2.4vh, 22px) clamp(12px, 3vw, 32px) clamp(10px, 3vh, 30px);
  overflow: hidden;
  background:
    radial-gradient(70% 55% at 50% 100%, rgba(75, 74, 232, 0.10), transparent 70%),
    radial-gradient(50% 40% at 50% 0%, #fbfaf7, transparent 80%),
    var(--page);
}

/* ---- the bar of the landing page ---- */
.nav {
  width: min(100%, 980px);
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 13px;
  flex: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 650;
  font-stretch: 108%;
  letter-spacing: -0.01em;
}

.brand__mark {
  width: 20px;
  height: 20px;
  fill: none;
  stroke-width: 1.7;
}

.brand__mark circle:first-child {
  stroke: var(--ink);
}

.brand__mark circle:last-child {
  stroke: var(--accent);
}

.nav__links {
  display: flex;
  gap: 18px;
  margin-left: 10px;
  color: var(--muted);
}

.nav__cta {
  margin-left: auto;
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--paper);
  box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(21, 21, 26, 0.06);
  font-weight: 560;
}

/* ---- the headline ---- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-top: clamp(14px, 6vh, 64px);
  flex: none;
}

.eyebrow {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 11px 4px 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(21, 21, 26, 0.05);
  font-size: 12px;
  color: var(--muted);
}

.eyebrow__tag {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

.title {
  margin: clamp(10px, 2.4vh, 22px) 0 0;
  font-size: clamp(22px, min(6.6vw, 9vh), 78px);
  line-height: 1.12;
  letter-spacing: -0.035em;
  font-weight: normal;
}

.title__line {
  display: block;
  white-space: nowrap;
}

.w {
  --w: 640;
  --s: 100;
  display: inline-block;
  font-variation-settings: 'wght' var(--w), 'wdth' var(--s);
}

.title__line:first-child .w {
  color: var(--ink);
}

/* a pill is a button for GSAP (scale, width of its window), its face is for the CSS */
.w--pill {
  position: relative;
  vertical-align: baseline;
}

.pill {
  position: relative;
  display: inline-block;
  padding: 0;
  margin: 0 0.02em;
  border: 0;
  background: none;
  cursor: pointer;
  letter-spacing: inherit;
  font-variation-settings: inherit;
  -webkit-tap-highlight-color: transparent;
}

.pill__face {
  display: inline-flex;
  align-items: center;
  gap: 0.12em;
  padding: 0.02em 0.22em 0.04em 0.3em;
  border-radius: 0.3em;
  background: linear-gradient(180deg, #ffffff, #faf9f6);
  box-shadow:
    inset 0 1px 0 #fff,
    0 0 0 1px rgba(21, 21, 26, 0.09),
    0 1px 1px rgba(21, 21, 26, 0.04),
    0 6px 14px -6px rgba(21, 21, 26, 0.16),
    0 18px 36px -18px rgba(75, 74, 232, 0.28);
  transition: box-shadow 0.35s ease;
}

.pill--time .pill__face {
  color: var(--accent);
}

.pill.is-open .pill__face {
  box-shadow:
    inset 0 1px 0 #fff,
    0 0 0 1px rgba(75, 74, 232, 0.55),
    0 0 0 0.09em rgba(75, 74, 232, 0.14),
    0 6px 14px -6px rgba(21, 21, 26, 0.16),
    0 18px 36px -14px rgba(75, 74, 232, 0.4);
}

.pill__win {
  position: relative;
  display: inline-block;
  height: 1.12em;
  overflow: hidden;
  vertical-align: bottom;
  white-space: nowrap;
}

.pill__text {
  display: inline-block;
  will-change: transform;
}

.pill__text--next {
  position: absolute;
  left: 0;
  top: 0;
}

.pill__chev {
  width: 0.42em;
  height: 0.42em;
  flex: none;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  margin-top: 0.06em;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), stroke 0.3s ease;
}

.pill.is-open .pill__chev {
  transform: rotate(180deg);
  stroke: var(--accent);
}

.pill__measure {
  position: absolute;
  left: 0;
  top: 0;
  visibility: hidden;
  white-space: nowrap;
  pointer-events: none;
}

@media (hover: hover) {
  .pill:hover .pill__chev {
    stroke: var(--ink);
  }
  .pill--time:hover .pill__chev,
  .pill.is-open:hover .pill__chev {
    stroke: var(--accent);
  }
}

.pill:focus-visible {
  outline: none;
}

.pill:focus-visible .pill__face {
  box-shadow: 0 0 0 2px var(--accent), 0 6px 14px -6px rgba(21, 21, 26, 0.16);
}

.sub {
  margin: clamp(8px, 2vh, 18px) 0 0;
  max-width: 34em;
  font-size: clamp(12.5px, 1.6vw, 16px);
  line-height: 1.5;
  color: var(--muted);
  font-variation-settings: 'wght' 430, 'wdth' 100;
}

.ctas {
  display: flex;
  gap: 8px;
  margin-top: clamp(10px, 2.6vh, 24px);
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.72em 1.15em;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 580;
}

.btn--dark {
  background: linear-gradient(180deg, #2a2a31, var(--ink));
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 6px 16px -8px rgba(21, 21, 26, 0.6);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 0 1px var(--line);
}

/* ---- the calendar preview ---- */
.app {
  position: relative;
  width: min(100%, 880px);
  flex: 1 1 auto;
  min-height: 0;
  max-height: 360px;
  margin-top: clamp(12px, 4.4vh, 44px);
  padding: 0 4px;
}

.app__card {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff, #fdfcfa);
  box-shadow:
    inset 0 1px 0 #fff,
    0 0 0 1px rgba(21, 21, 26, 0.07),
    0 2px 4px rgba(21, 21, 26, 0.04),
    0 24px 60px -24px rgba(21, 21, 26, 0.25),
    0 40px 90px -40px rgba(75, 74, 232, 0.35);
  overflow: hidden;
}

.app__bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  flex: none;
}

.app__title {
  font-weight: 620;
}

.app__week {
  color: var(--muted);
}

.app__people {
  display: inline-flex;
  margin-left: auto;
}

.face {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-left: -4px;
  border-radius: 50%;
  font-size: 8px;
  font-weight: 650;
  letter-spacing: 0.02em;
  box-shadow: 0 0 0 2px #fff;
}

.face--a { background: #e8e6ff; color: #3c3bc4; }
.face--b { background: #ffe9d6; color: #a2551c; }
.face--c { background: #dcf1e6; color: #22704b; }
.face--d { background: #f1e3f5; color: #84408f; }

.app__free {
  min-width: 86px;
  font-weight: 560;
  color: var(--free);
}

.app__free-win {
  display: inline-block;
  height: 1.3em;
  overflow: hidden;
  vertical-align: bottom;
}

.app__free-text {
  display: inline-block;
}

.app__free-text.is-checking {
  color: var(--muted);
  background: linear-gradient(90deg, var(--muted) 0%, var(--muted) 35%, #d6d3cc 50%, var(--muted) 65%, var(--muted) 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shine 0.9s linear infinite;
}

@keyframes shine {
  from { background-position: 100% 0; }
  to { background-position: -150% 0; }
}

.toast {
  position: absolute;
  right: 10px;
  top: calc(100% + 8px);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px 6px 8px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 11.5px;
  font-weight: 540;
  box-shadow: 0 8px 20px -8px rgba(21, 21, 26, 0.5);
  opacity: 0;
  visibility: hidden;
}

.toast svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: #9fa0ff;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.cal {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 44px 1fr;
  grid-template-rows: 28px 1fr;
  padding: 0 12px 14px 0;
}

.cal__heads {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  font-size: 11px;
  color: var(--muted);
}

.head {
  justify-self: center;
  padding: 3px 8px;
  border-radius: 999px;
  transition: background-color 0.35s ease, color 0.35s ease;
}

.head b {
  font-weight: 600;
}

.head.is-on {
  background: rgba(75, 74, 232, 0.1);
  color: var(--accent);
}

.cal__hours {
  position: relative;
  grid-row: 2;
  font-size: 9.5px;
  color: #a9a6a0;
  margin: 8px 0 10px;
}

.cal__hours span {
  position: absolute;
  right: 8px;
  transform: translateY(-50%);
  white-space: nowrap;
}

.cal__grid {
  position: relative;
  grid-row: 2;
  grid-column: 2;
  margin: 8px 0 10px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.rule {
  position: absolute;
  left: 0;
  right: 0;
  height: 0;
  border-top: 1px dashed rgba(21, 21, 26, 0.07);
}

.col {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 1px solid rgba(21, 21, 26, 0.05);
}

.busy {
  position: absolute;
  padding: 3px 6px;
  border-radius: 6px;
  background:
    repeating-linear-gradient(135deg, rgba(21, 21, 26, 0.035) 0 4px, transparent 4px 8px),
    var(--busy);
  box-shadow: inset 0 0 0 1px rgba(21, 21, 26, 0.04);
  font-size: 9.5px;
  font-weight: 520;
  color: #9a978f;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.trail {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 8px;
  border: 1px dashed rgba(75, 74, 232, 0.55);
  background: rgba(75, 74, 232, 0.04);
  opacity: 0;
  pointer-events: none;
}

/* the meeting: the outer box is for GSAP (x, y, scale, rotation), the face is for the CSS */
.ev {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  will-change: transform;
}

.ev__face {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(170deg, var(--accent-2), var(--accent) 70%);
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 1px 2px rgba(40, 38, 160, 0.3),
    0 10px 22px -10px rgba(52, 50, 200, 0.7);
  transition: box-shadow 0.3s ease;
}

.ev__face::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.28) 48%, transparent 62%);
  transform: translateX(var(--sheen, -120%));
  pointer-events: none;
}

.ev.is-lifted .ev__face {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 2px 4px rgba(40, 38, 160, 0.25),
    0 22px 40px -14px rgba(52, 50, 200, 0.75);
}

.ev__name {
  flex: none;
  font-size: 11px;
  font-weight: 620;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ev__time {
  font-size: 9.5px;
  opacity: 0.82;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ev__faces {
  margin-left: auto;
  padding-left: 4px;
  display: flex;
  flex: none;
}

.ev__faces i {
  width: 10px;
  height: 10px;
  margin-left: -3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 0 1.5px var(--accent);
}

.ev__faces i:nth-child(2) { background: #ffd9b8; }
.ev__faces i:nth-child(3) { background: #c6ecd8; }
.ev__faces i:nth-child(4) { background: #f0d3f5; }

/* ---- the floating menu of a pill ---- */
.menu {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 10;
  width: 206px;
  padding: 6px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  box-shadow:
    inset 0 1px 0 #fff,
    0 0 0 1px rgba(21, 21, 26, 0.08),
    0 2px 4px rgba(21, 21, 26, 0.05),
    0 18px 40px -12px rgba(21, 21, 26, 0.28),
    0 30px 60px -30px rgba(75, 74, 232, 0.4);
  font-size: 13px;
  text-align: left;
  opacity: 0;
  visibility: hidden;
}

.menu__label {
  margin: 4px 8px 6px;
  font-size: 10.5px;
  font-weight: 560;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.menu__list {
  position: relative;
}

.menu__hi {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 32px;
  border-radius: 9px;
  background: rgba(75, 74, 232, 0.08);
  box-shadow: inset 0 0 0 1px rgba(75, 74, 232, 0.12);
  opacity: 0;
}

.opt {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 32px;
  padding: 0 9px;
  border: 0;
  border-radius: 9px;
  background: none;
  cursor: pointer;
  text-align: left;
  font-variation-settings: 'wght' 500, 'wdth' 100;
  transition: font-variation-settings 0.3s ease, color 0.3s ease;
}

.opt.is-hot {
  color: var(--accent);
  font-variation-settings: 'wght' 620, 'wdth' 104;
}

.opt__meta {
  margin-left: auto;
  font-size: 11px;
  color: var(--free);
  font-variation-settings: 'wght' 520, 'wdth' 100;
}

.opt__meta--muted {
  color: var(--muted);
}

.opt__tick {
  width: 14px;
  height: 14px;
  margin-left: 6px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
}

.opt.is-chosen .opt__tick {
  opacity: 1;
}

/* the pointer that shows it */
.ghost {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 20;
  width: 22px;
  height: 22px;
  fill: var(--ink);
  stroke: #fff;
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25));
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}

/* ---- the phone box and small screens ---- */
@media (max-width: 640px) {
  .nav__links {
    display: none;
  }
  .btn--ghost {
    display: none;
  }
  .app__week {
    display: none;
  }
  .cal {
    grid-template-columns: 34px 1fr;
    padding-right: 8px;
  }
}

@media (max-width: 420px) {
  .app__title {
    display: none;
  }
  .app__people {
    margin-left: 0;
  }
  .app__free {
    margin-right: auto;
  }
  .head {
    padding: 3px 5px;
  }
  .busy {
    font-size: 0;
  }
  .ev__time {
    display: none;
  }
  .ev__faces {
    display: none;
  }
}

@media (max-height: 520px) {
  .sub {
    display: none;
  }
  .hero {
    margin-top: clamp(10px, 3vh, 24px);
  }
}

@media (max-height: 430px) {
  .eyebrow {
    display: none;
  }
}
