/* MAMMOTH: shared system for the homepage variations.
   Rule of the brand: nothing is round. Every edge is a block edge. */

:root {
  --blue: #0f5ef7;
  --glow: #3f8cff;
  --u: 20px;              /* one block: the unit every stepped cut is built from */
  --gut: clamp(20px, 3.4vw, 48px);
  --head: 68px;
  --display: "Archivo", "Arial Black", sans-serif;
  --body: "Hanken Grotesk", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
:root[data-theme="dark"] {
  --bg: #050506; --bg-2: #0d0d0f; --bg-3: #17171a;
  --ink: #f4f2ee; --mut: #a0a2a7;
  --line: rgba(255, 255, 255, .14);
  --head-bg: rgba(5, 5, 6, .72);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #e9e4db; --bg-2: #f3efe8; --bg-3: #d9d3c8;
  --ink: #0a0a0b; --mut: #55544f;
  --line: rgba(10, 10, 11, .18);
  --head-bg: rgba(233, 228, 219, .78);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; border-radius: 0 !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--body); font-size: 17px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
  transition: background-color .45s ease, color .45s ease;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
/* width and height attributes are there for layout stability; let CSS decide the real height */
img { height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--glow); outline-offset: 3px; }

/* Type ------------------------------------------------------------- */
.mega {
  font-family: var(--display); font-weight: 900; font-stretch: 62%;
  line-height: .82; letter-spacing: -.012em; text-transform: uppercase; white-space: nowrap;
}
.title {
  font-family: var(--display); font-weight: 900; font-stretch: 100%;
  line-height: .94; letter-spacing: -.035em;
}
.label {
  font-family: var(--mono); font-size: 12px; font-weight: 500; line-height: 1.5;
  letter-spacing: .14em; text-transform: uppercase;
}
.lead { font-size: clamp(18px, 1.5vw, 22px); line-height: 1.32; }
.blue { color: var(--blue); font-weight: 700; }
:root[data-theme="dark"] .blue { color: var(--glow); }

/* Buttons ---------------------------------------------------------- */
.btn {
  position: relative; display: inline-flex; align-items: center; gap: 14px;
  height: 52px; padding: 0 24px; white-space: nowrap;
  font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  background: var(--blue); color: #fff;
  /* the brand move: a bright seam between two blocks */
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22), 0 0 0 rgba(63, 140, 255, 0);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
  transition: box-shadow .3s, background-color .3s, clip-path .3s var(--ease);
}
.btn:hover { background: #2a75ff; clip-path: polygon(0 0, 100% 0, 100% 100%, 100% 100%, 100% 100%, 0 100%); }
.btn .arr { transition: transform .3s var(--ease); }
.btn:hover .arr { transform: translate(3px, -3px); }
.btn--line {
  background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); clip-path: none;
}
.btn--line:hover { background: var(--ink); color: var(--bg); clip-path: none; }
.link {
  font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  padding-bottom: 4px; border-bottom: 1px solid var(--mut); transition: border-color .2s, color .2s;
}
.link:hover { border-color: var(--glow); color: var(--glow); }
.cta-row { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 24px; }

/* Header: Resend's structure, cut square --------------------------- */
.head {
  position: fixed; inset: 0 0 auto; z-index: 50; height: var(--head);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 var(--gut); border-bottom: 1px solid transparent;
  transition: background-color .3s, border-color .3s;
}
.head.is-stuck, .head.is-open {
  background: var(--head-bg); border-color: var(--line);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.brand { display: inline-flex; align-items: center; gap: 12px; justify-self: start; }
.brand__cube { width: 34px; height: 34px; }
.brand__word { width: 124px; height: 15px; background: currentColor;
  -webkit-mask: url(logo/wordmark.svg) center/contain no-repeat; mask: url(logo/wordmark.svg) center/contain no-repeat; }
:root[data-theme="dark"] .only-light, :root[data-theme="light"] .only-dark { display: none; }

.nav { display: flex; align-items: stretch; height: var(--head); }
.nav__item { position: static; display: flex; }
.nav__link {
  display: inline-flex; align-items: center; gap: 7px; padding: 0 14px;
  color: var(--mut); font-size: 14px; font-weight: 500; transition: color .2s;
}
.nav__link:hover, .nav__item.open .nav__link { color: var(--ink); }
.chev { width: 8px; height: 8px; transition: transform .2s; }
.nav__item.open .chev { transform: rotate(180deg); }

.head__right { justify-self: end; display: flex; align-items: center; gap: 10px; }
.head__cta {
  display: inline-flex; align-items: center; height: 40px; padding: 0 16px;
  font-size: 14px; font-weight: 600; box-shadow: inset 0 0 0 1px var(--line); background: var(--bg-3);
  transition: background-color .2s, color .2s;
}
.head__cta:hover { background: var(--ink); color: var(--bg); }

/* Theme toggle: one block sliding between two sockets */
.tog {
  position: relative; display: grid; grid-template-columns: 1fr 1fr; width: 76px; height: 40px;
  box-shadow: inset 0 0 0 1px var(--line); color: var(--mut);
}
.tog span { position: relative; z-index: 1; display: grid; place-items: center; transition: color .25s; }
.tog svg { width: 15px; height: 15px; }
.tog::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 50%;
  background: var(--ink); transition: transform .32s var(--ease);
}
:root[data-theme="light"] .tog::before { transform: translateX(100%); }
:root[data-theme="dark"] .tog span:first-child, :root[data-theme="light"] .tog span:last-child { color: var(--bg); }

/* Mega menu */
.mega-menu {
  position: absolute; top: calc(var(--head) - 1px); left: 50%; width: min(760px, calc(100vw - 2 * var(--gut)));
  display: grid; grid-template-columns: 1fr 1fr 1.15fr; gap: 1px; padding: 1px;
  background: var(--line); transform: translate(-50%, -6px); opacity: 0; visibility: hidden;
  transition: opacity .18s, transform .18s var(--ease), visibility .18s;
}
.nav__item.open .mega-menu { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.mega-menu__col, .mega-menu__card { background: var(--bg-2); padding: 18px; }
.mega-menu__col a {
  display: block; padding: 7px 8px; margin: 0 -8px; color: var(--mut); font-size: 14px; font-weight: 500;
  transition: color .15s, background-color .15s;
}
.mega-menu__col a:hover { color: var(--ink); background: var(--bg-3); }
.mega-menu__soon { display: block; padding: 7px 0; color: var(--mut); font-size: 14px; opacity: .75; }
.mega-menu__soon em { font-family: var(--mono); font-style: normal; font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--glow); margin-left: 6px; }
.mega-menu__head { display: block; color: var(--mut); margin-bottom: 10px; font-size: 11px; }
.mega-menu__card { position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: 170px; overflow: hidden; }
.mega-menu__card b { position: relative; font-family: var(--display); font-size: 21px; font-weight: 900; line-height: 1.02; letter-spacing: -.02em; }
.mega-menu__card small { position: relative; color: var(--mut); font-size: 13px; margin-top: 6px; }
.mega-menu__card i { position: absolute; top: 18px; right: 18px; width: 22px; height: 22px; background: var(--blue); box-shadow: -30px 30px 0 var(--ink), 0 30px 0 var(--bg-3), -30px 0 0 var(--bg-3); }

.burger { display: none; width: 40px; height: 40px; box-shadow: inset 0 0 0 1px var(--line); place-items: center; }
.burger i, .burger i::before { display: block; width: 16px; height: 2px; background: var(--ink); }
.burger i { position: relative; top: -3px; }
.burger i::before { content: ""; position: relative; top: 6px; }

/* Blocks ------------------------------------------------------------ */
.seam { position: relative; }
.seam::after {
  content: ""; position: absolute; width: 2px; top: 0; bottom: 0; right: -1px;
  background: var(--glow); box-shadow: 0 0 14px 2px var(--glow);
}
.cube { display: inline-block; width: var(--c, 26px); height: var(--c, 26px); background: var(--ink); }
.cube--b { background: var(--blue); box-shadow: 0 0 18px rgba(63, 140, 255, .65); }
.cube--m { background: var(--mut); opacity: .55; }

/* Stack of blocks: a growing idea, drawn in real squares */
.stack { display: inline-grid; grid-auto-flow: column; align-items: end; gap: 3px; }
.stack > span { display: grid; gap: 3px; align-content: end; }

/* Theme-swapped artwork: both layers stay in place and crossfade */
.art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .5s ease; }
:root[data-theme="dark"] .art--light, :root[data-theme="light"] .art--dark { opacity: 0; }

/* Entrance */
@media (prefers-reduced-motion: no-preference) {
  .rise { opacity: 0; transform: translateY(26px); animation: rise .9s var(--ease) forwards; animation-delay: var(--d, 0s); }
  @keyframes rise { to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Review switcher: for client review only, removed from the final site */
.review {
  position: fixed; right: 16px; bottom: 16px; z-index: 60; display: flex;
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em;
  background: #000; color: #fff; box-shadow: 0 0 0 1px rgba(255, 255, 255, .24);
}
.review a { display: grid; place-items: center; min-width: 34px; height: 34px; padding: 0 8px; color: #b7b9bd; }
.review a:hover { color: #fff; }
.review a[aria-current] { background: var(--blue); color: #fff; }
.review a.review__all { border-right: 1px solid rgba(255, 255, 255, .24); padding: 0 12px; }

@media (max-width: 960px) {
  .head { grid-template-columns: 1fr auto; }
  .nav { display: none; position: fixed; top: var(--head); left: 0; right: 0; height: auto; flex-direction: column; padding: 8px var(--gut) 20px; background: var(--bg-2); border-bottom: 1px solid var(--line); }
  .head.is-open .nav { display: flex; }
  .nav__item { flex-direction: column; }
  .nav__link { padding: 14px 0; font-size: 18px; color: var(--ink); justify-content: space-between; }
  .mega-menu { display: none; position: static; width: 100%; transform: none; opacity: 1; visibility: visible; grid-template-columns: 1fr; background: none; padding: 0 0 8px; }
  .nav__item.open .mega-menu { display: block; transform: none; }
  .mega-menu__col { padding: 0 0 8px; background: none; }
  .mega-menu__head, .mega-menu__card { display: none; }
  .mega-menu__col a { margin: 0; padding: 8px 0; }
  .burger { display: grid; }
  .head__cta { display: none; }
  .review { right: 8px; bottom: 8px; }
}

/* Text selection: the brand's light blue */
::selection { background: #3f8cff; color: #050506; }
.blue-p ::selection, .hx--blue ::selection, .btn::selection, .btn ::selection { background: #fff; color: #0f5ef7; }
