/* ═══════════════════════════════════════════════════════════════
   Sidetake — site shell: tokens, grid, type, nav, buttons, panels,
   footer. The story sections live in story.css; the sign-up sheet
   in sheet.css.

   Structure and motion follow the reference Hemang chose (a single
   eased vertical story: framed hero, a list that fills as it scrolls,
   a pinned process scene, bands, giant counters, a dealt deck), with
   its colour roles mapped onto Sidetake's own:
     reference blue   → emerald  (the bold full-bleed blocks)
     reference orange → sage     (buttons, highlights, the "student")
     reference grey   → ink      (the page, under the same fine grid)
   Type stays Geist + Inter — hierarchy from weight and size only.
   ═══════════════════════════════════════════════════════════════ */

/* Self-hosted variable fonts — latin + latin-ext only. Replaces the render-blocking Google Fonts request. */
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url('fonts/geist-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url('fonts/geist-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #0a100e;
  --ink-2: #101916;
  --ink-3: #06090a;
  --em: #0d6446;
  --em-2: #0b573d;
  --sage: #45d69f;
  --sage-deep: #1e8a6c;
  --gold: #d8c16a;
  --rose: #e45d7d;

  --text: #f4faf7;
  --text-2: rgba(244, 250, 247, 0.74);
  --text-3: rgba(244, 250, 247, 0.46);
  --dim: rgba(244, 250, 247, 0.13);
  --surface: rgba(255, 255, 255, 0.05);
  --line: rgba(255, 255, 255, 0.12);
  --line-2: rgba(255, 255, 255, 0.22);
  --grid-ink: rgba(255, 255, 255, 0.045);
  --grid-em: rgba(255, 255, 255, 0.09);

  --font-display: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --frame: clamp(8px, 0.75vw, 14px);   /* the gap between framed blocks */
  --gut: clamp(1rem, 0.6rem + 2vw, 2.5rem);
  --pad: clamp(1rem, 0.7rem + 1vw, 1.5rem);
  --cell: 90px;                         /* grid cell; pixels dissolve at half this */
  --seam: 26vh;                         /* the pixel-dissolve zone between blocks */
  --r: 8px;
  --radius: 10px;

  --dur: 320ms;
  --dur-slow: 620ms;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}
/* Lenis takes over scrolling when it runs */
html.lenis,
html.lenis body {
  height: auto;
}
.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}
.lenis.lenis-stopped {
  overflow: hidden;
}

body {
  margin: 0;
  background-color: var(--ink);
  background-image: linear-gradient(var(--grid-ink) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-ink) 1px, transparent 1px);
  background-size: var(--cell) var(--cell);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.grid--em {
  background-color: var(--em);
  background-image: linear-gradient(var(--grid-em) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-em) 1px, transparent 1px);
  background-size: var(--cell) var(--cell);
}

img,
svg {
  display: block;
  max-width: 100%;
}
h1,
h2,
h3,
h4,
p {
  margin: 0;
}
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.05;
}
ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  font: inherit;
  color: inherit;
}
:focus-visible {
  outline: 2px solid var(--sage);
  outline-offset: 3px;
  border-radius: 4px;
}
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  padding: 0.75rem 1rem;
  background: var(--sage);
  color: var(--ink);
  font-weight: 700;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
}

/* ══════════ type ══════════ */

.mega {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.5rem, 0.9rem + 6.6vw, 7.4rem);
  line-height: 0.88;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}
.mega > span {
  display: block;
}
.label {
  font-family: var(--font-body);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--sage);
}

/* ══════════ panels — the framed blocks of the reference ══════════ */

.panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--ink-2);
}
.panel--ink {
  background: var(--ink);
  border-color: rgba(255, 255, 255, 0.16);
}
.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem var(--pad);
  border-bottom: 1px solid var(--line);
}
.panel__glyphs {
  display: flex;
  gap: 0.3rem;
}
.panel__glyphs i {
  display: grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  padding-inline: 0.3rem;
  border: 1px solid var(--line-2);
  border-radius: 5px;
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 600;
  color: var(--sage);
}

/* section number: a corner square with a diagonal, like a folded tab */
.secnum {
  position: absolute;
  top: var(--pad);
  right: var(--pad);
  width: clamp(48px, 4.5vw, 64px);
  aspect-ratio: 1;
  border: 1px solid var(--line-2);
  background: linear-gradient(
    to top right,
    transparent calc(50% - 0.5px),
    var(--line-2) 50%,
    transparent calc(50% + 0.5px)
  );
}
.secnum b {
  position: absolute;
  left: 0.4rem;
  bottom: 0.25rem;
  font-family: var(--font-display);
  font-size: clamp(1rem, 0.8rem + 0.5vw, 1.35rem);
  font-weight: 800;
  color: var(--sage);
}

/* ══════════ buttons ══════════ */

.btn {
  --bg: var(--sage);
  --fg: var(--ink);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.78rem 1.15rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  overflow: hidden;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
    background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.5) 50%, transparent 62%);
  translate: -120% 0;
  transition: translate 650ms var(--ease-out);
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px -14px rgba(69, 214, 159, 0.8);
}
.btn:hover::after {
  translate: 120% 0;
}
.btn:active {
  transform: translateY(0);
}
.btn--sm {
  padding: 0.6rem 0.85rem;
  font-size: 0.7rem;
}
.btn--ghost {
  --bg: transparent;
  --fg: var(--text);
  border-color: var(--line-2);
}
.btn--ghost:hover {
  --bg: var(--surface);
  border-color: rgba(69, 214, 159, 0.55);
  box-shadow: none;
}
.btn--ghost::after {
  display: none;
}

/* store buttons */
.stores {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
}
.store {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 1rem 0.55rem 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  background: rgba(6, 9, 10, 0.55);
  backdrop-filter: blur(10px);
  overflow: hidden;
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease),
    background var(--dur) var(--ease);
}
.store:hover {
  transform: translateY(-2px);
  border-color: var(--sage);
  background: rgba(6, 9, 10, 0.8);
}
.store__mark {
  width: 22px;
  height: 22px;
  flex: none;
}
.store__txt {
  display: flex;
  flex-direction: column;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.store__txt small {
  font-family: var(--font-body);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(244, 250, 247, 0.6);
}
.store--sm {
  padding: 0.42rem 0.75rem 0.42rem 0.6rem;
}
.store--sm .store__mark {
  width: 18px;
  height: 18px;
}
.store--sm .store__txt {
  font-size: 0.82rem;
}

/* ══════════ nav — floats over the story, no bar ══════════ */

.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 60;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: calc(var(--frame) + 14px) calc(var(--frame) + 20px);
  pointer-events: none;
  transition: padding var(--dur) var(--ease);
}
.nav::before {
  /* a soft scrim once the page moves, so the nav reads over anything */
  content: '';
  position: absolute;
  inset: 0 0 -26px;
  z-index: -1;
  background: linear-gradient(rgba(6, 9, 10, 0.78), transparent);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
.nav.is-scrolled {
  padding-block: calc(var(--frame) + 6px);
}
.nav.is-scrolled::before {
  opacity: 1;
}
.nav > * {
  pointer-events: auto;
}
.brand {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  transition: color var(--dur) var(--ease);
}
.brand:hover {
  color: var(--sage);
}
.brand__mark {
  width: 1.55em;
  height: 1.55em;
  flex: none;
  background: currentColor;
  -webkit-mask: url(/logo.svg) center / contain no-repeat;
  mask: url(/logo.svg) center / contain no-repeat;
  transition: rotate var(--dur-slow) var(--ease);
}
.brand:hover .brand__mark {
  rotate: -10deg;
}
.nav__live {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  background: linear-gradient(95deg, #45d69f, #8ee8c2 55%, #45d69f);
  background-size: 200% 100%;
  color: var(--ink);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  animation: live-sheen 5s linear infinite;
  transition: transform var(--dur) var(--ease);
}
.nav__live:hover {
  transform: translateY(-1px);
}
.nav__live i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink);
  animation: ping-dark 2.2s var(--ease-out) infinite;
}
@keyframes live-sheen {
  to {
    background-position: -200% 0;
  }
}
@keyframes ping-dark {
  0% {
    box-shadow: 0 0 0 0 rgba(10, 16, 14, 0.5);
  }
  70%,
  100% {
    box-shadow: 0 0 0 7px rgba(10, 16, 14, 0);
  }
}
.nav__right {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.nav__menu {
  display: grid;
  align-content: center;
  gap: 4px;
  width: 38px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: rgba(6, 9, 10, 0.55);
  backdrop-filter: blur(10px);
  cursor: pointer;
  transition: border-color var(--dur) var(--ease);
}
.nav__menu:hover {
  border-color: var(--sage);
}
.nav__menu span {
  display: block;
  height: 1.5px;
  background: var(--text);
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.nav__menu.is-open span:nth-child(1) {
  transform: translateY(5.5px) rotate(45deg);
}
.nav__menu.is-open span:nth-child(2) {
  opacity: 0;
}
.nav__menu.is-open span:nth-child(3) {
  transform: translateY(-5.5px) rotate(-45deg);
}

/* the invite-only Compass layer sits behind this — deliberately quiet */
.nav__admin {
  gap: 0.4rem;
  --fg: var(--text-2);
  border-color: var(--line);
  background: rgba(6, 9, 10, 0.45);
  backdrop-filter: blur(10px);
}
.nav__admin:hover {
  --fg: var(--text);
}
.nav__admin svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ══════════ drawer ══════════ */

.drawer {
  position: fixed;
  top: var(--frame);
  right: var(--frame);
  z-index: 55;
  display: grid;
  gap: 1.4rem;
  width: min(calc(100% - var(--frame) * 2), 26rem);
  padding: 4.8rem 1.4rem 1.4rem;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: rgba(10, 16, 14, 0.96);
  backdrop-filter: blur(18px);
  transform-origin: top right;
  scale: 0.96;
  opacity: 0;
  visibility: hidden;
  transition: scale var(--dur) var(--ease), opacity var(--dur) var(--ease),
    visibility 0s linear var(--dur);
}
.drawer.is-open {
  scale: 1;
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}
.drawer__links {
  display: grid;
}
.drawer__links a {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  padding-block: 0.7rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  transition: color var(--dur) var(--ease), padding var(--dur) var(--ease);
}
.drawer__links a:hover {
  color: var(--sage);
  padding-left: 0.3rem;
}
.drawer__links span {
  font-family: var(--font-body);
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--sage);
}
.drawer__foot {
  display: grid;
  gap: 0.7rem;
}
.drawer__foot .stores {
  justify-content: flex-start;
}
.drawer__admin {
  width: fit-content;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-3);
  transition: color var(--dur) var(--ease);
}
.drawer__admin:hover {
  color: var(--sage);
}

/* ══════════ reveal ══════════ */

.js .reveal {
  opacity: 0;
  translate: 0 26px;
  transition: opacity 800ms var(--ease-out), translate 800ms var(--ease-out);
}
.js .reveal.is-in {
  opacity: 1;
  translate: 0 0;
}

/* ══════════ footer — dark framed blocks ══════════ */

.foot {
  display: grid;
  gap: var(--frame);
  padding: var(--frame);
}
.foot__grid {
  display: grid;
  grid-template-columns: minmax(220px, 24%) repeat(3, 1fr);
  gap: var(--frame);
}
.foot__grid > * {
  border-radius: var(--r);
  background: var(--ink-3);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.foot__brand {
  grid-row: span 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 13rem;
  font-family: var(--font-display);
  font-size: clamp(2rem, 1rem + 2.6vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
}
.foot__signup {
  grid-column: span 3;
  display: grid;
  gap: 0.5rem;
  padding: 1.4rem 1.5rem;
}
.foot__signup p:not(.label) {
  max-width: 44ch;
  color: var(--text-2);
}
.foot__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.foot__col {
  display: grid;
  align-content: start;
  gap: 0.5rem;
  padding: 1.2rem 1.5rem 1.5rem;
}
.foot__col .label {
  margin-bottom: 0.3rem;
}
.foot__col a {
  width: fit-content;
  font-size: 0.92rem;
  color: var(--text-2);
  transition: color var(--dur) var(--ease), translate var(--dur) var(--ease);
}
.foot__col a:hover {
  color: var(--sage);
  translate: 3px 0;
}
.foot__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1.5rem;
  padding: 0.9rem 1.5rem;
  border-radius: var(--r);
  background: var(--ink-3);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-3);
}
.foot__bar a:hover {
  color: var(--sage);
}

/* ══════════ responsive ══════════ */

/* Touch pointers only: the small text links and pills sit at ~24-32px, which
   clears the WCAG minimum but is tight for a thumb. Grow the hit area, not the
   type — the column gap shrinks by what the padding adds, so the rhythm holds. */
@media (pointer: coarse) {
  .foot__col {
    gap: 0.2rem;
  }
  .foot__col a {
    padding-block: 0.35rem;
  }
  .btn--sm {
    /* taller only — growing the width would crowd the nav on a small phone */
    padding-block: 0.72rem;
  }
}

/* Small phones: the wordmark and the nav pill met with no gap at 320px.
   Trim the nav's own padding and the pill's width to open that up. */
@media (max-width: 900px) {
  .nav__admin span {
    display: none;
  }
  .nav__admin {
    padding-inline: 0.62rem;
  }
}
@media (max-width: 400px) {
  .nav__admin {
    display: none;
  }
  .nav {
    padding: calc(var(--frame) + 12px) calc(var(--frame) + 10px);
  }
  .nav .btn--sm {
    padding-inline: 0.7rem;
    font-size: 0.66rem;
  }
  .brand {
    font-size: 1rem;
  }
}

@media (max-width: 900px) {
  :root {
    --cell: 60px;
    --seam: 18vh;
  }
  .nav__live {
    display: none;
  }
  .nav {
    grid-template-columns: 1fr auto;
  }
  .foot__grid {
    grid-template-columns: 1fr;
  }
  .foot__brand {
    grid-row: auto;
    min-height: 9rem;
  }
  .foot__signup {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .js .reveal {
    opacity: 1;
    translate: 0 0;
  }
}
