/* ==========================================================================
   Bee Li — landing page
   Layout: one left-aligned column, centred; uniform grey Inter, light theme.
   ========================================================================== */

/* Reset
   ------------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }
img { max-width: 100%; display: block; }

/* Design tokens
   ------------------------------------------------------------------------ */
:root {
  --bg: #FCFCFB;
  --fg: #1A1A1D;
  --muted: #6E6E76;
  --underline: rgba(110, 110, 118, 0.45);
  --underline-strong: rgba(26, 26, 29, 0.4);
  --accent: #3B4ECC;
  --logo-yellow: #FFBA1A;
  --logo-ink: #191B32;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

/* Base
   ------------------------------------------------------------------------ */
body {
  background: var(--bg);
  color: var(--muted);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.003em;
}

/* Text selection — black background, yellow text (matching the logo) */
::selection { background: var(--logo-ink); color: var(--logo-yellow); }
::-moz-selection { background: var(--logo-ink); color: var(--logo-yellow); }

/* Layout
   ------------------------------------------------------------------------ */
.wrap {
  max-width: 704px;
  margin-inline: auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
  padding-block: clamp(4rem, 14vh, 10rem);
}
.col { display: flex; flex-direction: column; gap: 32px; }
.head { display: flex; flex-direction: column; gap: 24px; }

/* Brand
   ------------------------------------------------------------------------ */
.brand { display: flex; align-items: center; gap: 8px; }
.brand__logo { width: 32px; height: 32px; }
.brand__stripes { transition: fill 0.25s ease; }
@media (prefers-reduced-motion: reduce) {
  .brand__stripes { transition: none; }
}
.brand__name {
  font-size: clamp(1.25rem, 1.05rem + 0.8vw, 1.5rem);
  line-height: 1.2;
  color: var(--muted);
}

/* Text
   ------------------------------------------------------------------------ */
.lede, .body p {
  font-size: clamp(1.25rem, 1.05rem + 0.8vw, 1.5rem);
  line-height: 1.7;
  color: var(--muted);
  margin: 0;
}
.body { display: flex; flex-direction: column; gap: 18px; }

/* Links
   ------------------------------------------------------------------------ */
a.ln {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-style: dashed;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  text-decoration-color: var(--underline-strong);
  transition: color 0.18s ease, text-decoration-color 0.18s ease;
}
a.ln:hover { color: var(--fg); text-decoration-color: var(--fg); }

/* Highlighter-pen sweep: a yellow band (logo yellow at 60%) drawn behind the
   link from left to right on hover or keyboard focus. Add "ln--mark" to a link. */
a.ln--mark {
  position: relative;
  z-index: 0; /* keeps the stroke behind the text but above the page */
}
/* The stroke itself: an SVG brush shape with rough, bristly edges, stretched
   to the width of the word and revealed left to right by un-clipping it. */
a.ln--mark::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 4% -5px 0;
  background: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20100%2040'%20preserveAspectRatio='none'%3E%3Cfilter%20id='r'%20x='-10%25'%20y='-30%25'%20width='120%25'%20height='160%25'%3E%3CfeTurbulence%20type='fractalNoise'%20baseFrequency='0.03%200.35'%20numOctaves='2'%20seed='4'%20result='n'/%3E%3CfeDisplacementMap%20in='SourceGraphic'%20in2='n'%20scale='10'%20xChannelSelector='R'%20yChannelSelector='G'/%3E%3C/filter%3E%3Cpath%20filter='url(%23r)'%20fill='%23FFBA1A'%20fill-opacity='0.6'%20d='M5%2010C22%207%2046%209%2070%207S93%208%2096%2011C97%2018%2095%2025%2096%2031C80%2034%2052%2032%2030%2034S8%2033%204%2030C3%2024%205%2017%205%2010Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  clip-path: inset(0 100% 0 0); /* hidden: clipped away from the right */
  transition: clip-path 0.3s ease-out;
  pointer-events: none;
}
a.ln--mark:focus-visible::before { clip-path: inset(0 0 0 0); }
@media (hover: hover) {
  a.ln--mark:hover::before { clip-path: inset(0 0 0 0); }
}
@media (prefers-reduced-motion: reduce) {
  a.ln--mark::before { transition: none; }
}

/* Footer sits 48px below the main text: the column's 32px gap plus 16px */
.col > nav { margin-top: 16px; }
.foot {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}
.foot a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding-block: 4px; /* keeps each link at least 24px tall for easy tapping */
  font-size: 15px;
  color: var(--fg);
  text-decoration: underline;
  text-decoration-style: dashed;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  text-decoration-color: var(--underline-strong);
  transition: text-decoration-color 0.18s ease;
}
.foot a:hover { text-decoration-color: var(--fg); }
.foot .arrow { text-decoration: none; }

/* Link preview
   A small app icon that pops up above a link on hover or keyboard focus.
   Markup: <span class="pop"><a class="ln">…</a><img class="pop__img" alt=""></span>
   ------------------------------------------------------------------------ */
.pop { position: relative; white-space: nowrap; }
.pop__img {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  width: 40px;
  height: 40px;
  max-width: none;
  border-radius: 10px;
  box-shadow: 0 2px 3px 0 rgba(26, 26, 29, 0.12);
  opacity: 0;
  visibility: hidden;
  /* --pop-rot is set by js/logo.js to a random tilt each time the link is hovered */
  /* Hidden state is 32px (0.8 scale); it grows to the full 40px when shown */
  transform: translate(-50%, 0) rotate(var(--pop-rot, 0deg)) scale(0.8);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  pointer-events: none;
}
.pop a:focus-visible + .pop__img {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0) rotate(var(--pop-rot, 0deg));
}
@media (hover: hover) {
  .pop a:hover + .pop__img {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0) rotate(var(--pop-rot, 0deg));
  }
}
@media (prefers-reduced-motion: reduce) {
  .pop__img { transition: none; transform: translate(-50%, 0) rotate(var(--pop-rot, 0deg)); }
}

/* Cursor label
   A small pill that follows the pointer over product links (see js/logo.js).
   Position is set with "translate"; the pop-in uses "scale" so the two never
   fight each other.
   ------------------------------------------------------------------------ */
.cursor-label {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 12;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--logo-ink);
  color: var(--logo-yellow);
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  scale: 0.8;
  transform-origin: 0 0;
  transition: opacity 0.15s ease, scale 0.15s ease;
}
.cursor-label.is-on { opacity: 1; scale: 1; }
@media (prefers-reduced-motion: reduce) {
  .cursor-label { transition: none; scale: 1; }
}

/* Text for screen readers only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Dot cursor
   Two small dots replace the system cursor (see js/logo.js). The script adds
   "has-dot-cursor" to <html> only for mouse/trackpad users who have not asked
   for reduced motion; everyone else keeps their normal system cursor.
   ------------------------------------------------------------------------ */
.has-dot-cursor,
.has-dot-cursor * { cursor: none !important; }

.cursor-dot {
  position: fixed;
  left: -4px; /* centres the 8px dot on the pointer */
  top: -4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease, scale 0.15s ease;
}
.cursor-dot--yellow { z-index: 10; background: var(--logo-yellow); }
.cursor-dot--ink { z-index: 11; background: var(--logo-ink); }
.dots-on .cursor-dot { opacity: 1; }
.dots-on.dots-link .cursor-dot { scale: 1.75; }  /* over ordinary links */
/* Over a product link the ink dot itself swells into the "Open" pill.
   The pill element sits exactly on the ink dot as an 8px circle of the same
   colour, then grows to its full width and height while the text fades in.
   On leaving it shrinks back to 8px before handing over to the dot again. */
.dots-on.dots-label .cursor-dot--yellow { opacity: 0; }
.dots-on.dots-label .cursor-dot--ink { opacity: 0; transition: none; }
.has-dot-cursor .cursor-label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 8px;
  height: 8px;
  padding: 0;
  overflow: hidden;
  scale: 1;
  transition: width 0.22s ease, height 0.22s ease, opacity 0s linear 0.22s;
}
.has-dot-cursor .cursor-label.is-on {
  width: var(--label-w, 67px);
  height: 28px;
  transition: width 0.22s ease, height 0.22s ease, opacity 0s;
}
.has-dot-cursor .cursor-label__text {
  flex: none;
  opacity: 0;
  transition: opacity 0.1s ease;
}
.has-dot-cursor .cursor-label.is-on .cursor-label__text {
  opacity: 1;
  transition: opacity 0.15s ease 0.1s;
}

/* Motion
   ------------------------------------------------------------------------ */
@media (prefers-reduced-motion: no-preference) {
  .col > * { animation: fade 0.6s ease both; }
  .col > *:nth-child(2) { animation-delay: 0.05s; }
  .col > *:nth-child(3) { animation-delay: 0.1s; }
  @keyframes fade {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
  }
}
