@font-face {
  font-family: "Panchang";
  src: url("assets/fonts/panchang-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Panchang";
  src: url("assets/fonts/panchang-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #000212;
  --ink: #eef1fa;
  --muted: #b6bdd2;
  --line: rgba(196, 206, 255, 0.11);
  --gold: #f0c27a;
  --display: "Panchang", ui-sans-serif, system-ui, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: clamp(16px, 4vw, 48px);
  --wrap: 1320px;
  --bar: clamp(64px, 9vh, 88px);
}

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

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--muted);
  font: 400 17px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--ink);
  text-decoration-line: underline;
  text-decoration-color: rgba(240, 194, 122, 0.5);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.24em;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

a:hover {
  color: var(--gold);
  text-decoration-color: var(--gold);
}

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

h1,
h2,
p {
  margin: 0;
}

h1,
h2 {
  color: var(--ink);
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.wrap {
  width: min(var(--wrap), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

.skip {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 10;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
}

.skip:focus {
  top: 16px;
}

/* The crystals' halo reaches past the screen edge; cut it there, not with a sideways scroll. */
main {
  overflow-x: clip;
}

/* Bar */

.bar {
  display: flex;
  align-items: center;
  height: var(--bar);
}

.logo {
  display: block;
  border-radius: 8px;
}

.logo img {
  width: auto;
  height: 52px;
}

/* First screen */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  align-items: center;
  gap: clamp(24px, 4vw, 64px);
  min-height: min(calc(100svh - var(--bar)), 920px);
  padding-bottom: clamp(24px, 4vh, 48px);
}

.hero h1 {
  font-size: clamp(2.25rem, 1rem + 3.6vw, 4.1rem);
  line-height: 1.02;
}

.index {
  max-width: 560px;
  margin: clamp(24px, 4vh, 40px) 0;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.index li {
  border-bottom: 1px solid var(--line);
}

.index a {
  display: grid;
  grid-template-columns: 32px 9.6em minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 48px;
  padding: 7px 2px;
  color: var(--muted);
  text-decoration: none;
}

.index img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.index .name {
  color: var(--ink);
  font-weight: 600;
  transition: color 0.2s ease;
}

.index a:hover .name {
  color: var(--gold);
}

/* The button is Max's 2022 design: navy glass, a warm gold core and a halo. */

.button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 15px 30px;
  border-radius: 999px;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  line-height: 24px;
  text-decoration: none;
  isolation: isolate;
  box-shadow: inset 0 4px 1px rgba(255, 255, 255, 0.14), 0 0 0 1px rgba(255, 255, 255, 0.18), 0 0 36px rgba(226, 164, 74, 0.14);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: transform 0.25s var(--ease-out);
}

.button::before,
.button::after {
  content: "";
  position: absolute;
  border-radius: inherit;
  pointer-events: none;
}

.button::before {
  inset: -9px;
  z-index: 0;
  background: radial-gradient(ellipse at 50% 50%, rgba(232, 180, 100, 0.3), rgba(232, 180, 100, 0) 68%);
  filter: blur(10px);
  opacity: 0.52;
}

.button::after {
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0) 52%),
    radial-gradient(ellipse at 50% 55%, rgba(240, 194, 122, 0.3) 0%, rgba(240, 194, 122, 0) 78%),
    radial-gradient(circle at 50% -40%, rgba(47, 61, 98, 0.8) 0%, rgba(8, 15, 31, 0.92) 72%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), inset 0 -10px 22px rgba(6, 10, 24, 0.35);
}

.button > span:not(.button-glint),
.button > svg {
  position: relative;
  z-index: 3;
}

.button svg {
  width: 1.3em;
  height: 1.3em;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  transition: transform 0.25s var(--ease-out);
}

.button-glint {
  position: absolute;
  inset: -1px;
  z-index: 2;
  padding: 1px;
  border-radius: inherit;
  pointer-events: none;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.button-glint > span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  aspect-ratio: 1;
  background: conic-gradient(from 290deg, rgba(255, 243, 216, 0) 0%, rgba(255, 243, 216, 0.96) 10%, rgba(255, 243, 216, 0) 20%);
  transform: translate(-50%, -50%);
}

.button:hover,
.button:focus-visible {
  color: #fff;
  transform: scale(1.06);
}

.button:hover svg,
.button:focus-visible svg {
  transform: translateY(0.18em);
}

@media (prefers-reduced-motion: no-preference) {
  .button-glint > span {
    animation: glint 4.76s linear infinite;
  }
}

@keyframes glint {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* The Silmarils, rendered in Blender (render/silmaril.py) */

.gems {
  position: relative;
  justify-self: center;
  width: 100%;
  max-width: calc((100svh - 150px) * 1.1);
  aspect-ratio: 11 / 10;
}

.gem {
  position: absolute;
  aspect-ratio: 1;
  isolation: isolate;
}

.gem::before {
  content: "";
  position: absolute;
  inset: -48%;
  z-index: -1;
  background: radial-gradient(ellipse at 50% 50%, rgba(246, 246, 255, 0.34) 0%, rgba(124, 218, 255, 0.18) 26%, rgba(137, 92, 255, 0.13) 43%, transparent 70%);
  filter: blur(14px);
  opacity: 0.34;
  pointer-events: none;
}

.gem img,
.gem canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* script.js spins each stone on a canvas over its still once the frames have loaded. */
.gems.spinning {
  cursor: grab;
  touch-action: pan-y pinch-zoom;
  -webkit-user-select: none;
  user-select: none;
}

.gems.spinning .gem-still {
  opacity: 0;
}

.gems.held,
.gems.held .gem {
  cursor: grabbing;
}

/* assets/js/pick.js: where the browser can draw the stones live, you pick them up instead. The stone
   out of its place draws on a canvas in a layer over the whole page. */
.gems.pick .gem {
  cursor: grab;
  touch-action: pan-y pinch-zoom;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.gems.pick .gem-still {
  pointer-events: none;
}

.gem.lifted .gem-still {
  opacity: 0;
  transition: opacity 0.2s;
}

.gem-layer {
  position: fixed;
  inset: 0;
  z-index: 20;
  overflow: hidden;
  pointer-events: none;
}

.gem-layer canvas {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transition: opacity 0.3s;
  touch-action: pan-y pinch-zoom;
  will-change: transform, opacity;
}

.gem-layer.live canvas {
  opacity: 1;
  transition: opacity 0.12s;
}

/* Catch it on its way home. */
.gem-layer.live:not(.held) canvas {
  pointer-events: auto;
  cursor: grab;
}

.gem-a {
  top: 26%;
  left: 8%;
  width: 37%;
}

.gem-b {
  top: 4%;
  left: 60%;
  width: 27%;
}

.gem-c {
  top: 58%;
  left: 52%;
  width: 32%;
}

@media (prefers-reduced-motion: no-preference) {
  .gem {
    animation: rise 1s var(--ease-out) both;
  }

  .gem-b {
    animation-delay: 0.08s;
  }

  .gem-c {
    animation-delay: 0.16s;
  }
}

@keyframes rise {
  from {
    transform: translateY(28px);
  }
}

/* Products */

.product {
  display: grid;
  align-content: center;
  padding-block: clamp(72px, 12vh, 136px);
  border-top: 1px solid var(--line);
}

.product h2 {
  font-size: clamp(1.75rem, 1rem + 2.4vw, 3rem);
  line-height: 1.05;
}

.icon {
  width: 56px;
  height: 56px;
  margin-bottom: 20px;
  border-radius: 13px;
}

.lede {
  margin-top: 14px;
  color: var(--ink);
  font-size: clamp(1.25rem, 1.05rem + 0.7vw, 1.6rem);
  font-weight: 600;
  line-height: 1.3;
  text-wrap: balance;
}

.product p + p {
  margin-top: 16px;
}

.product p:not(.lede):not(.links) {
  max-width: 34em;
}

.links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 28px;
}

.product p.links {
  margin-top: 28px;
}

.badge {
  border-radius: 9px;
}

.badge img {
  width: auto;
  height: 44px;
}

.shot {
  display: block;
  width: 100%;
  max-width: calc(var(--max-h) * var(--ar));
  margin-inline: auto;
}

.shot img {
  width: 100%;
  height: auto;
}

/* Auri: words left, devices right */

.auri {
  grid-template-columns: minmax(0, 5fr) minmax(0, 8fr);
  align-items: center;
  gap: clamp(32px, 5vw, 80px);
}

.auri .shot {
  --ar: 2188 / 1243;
  --max-h: 70svh;
}

/* Siaru: a split heading row over the full keyboard spread */

.siaru .head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: end;
  gap: 24px clamp(32px, 5vw, 80px);
}

.siaru .shot {
  --ar: 1760 / 1000;
  --max-h: 58svh;
  margin-top: clamp(32px, 6vh, 64px);
}

/* Voz: phone left, words right */

.voz {
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  align-items: center;
  gap: clamp(32px, 5vw, 80px);
}

.voz .shot {
  --ar: 1;
  --max-h: 76svh;
}

/* Vitadel: two apps side by side */

.vitadel {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 56px clamp(40px, 6vw, 112px);
}

.vitadel .shot {
  --ar: 1;
  --max-h: 40svh;
  margin: 0 0 20px;
}

.vitadel .icon {
  float: left;
  width: 48px;
  height: 48px;
  margin: 0 16px 0 0;
  border-radius: 11px;
}

.vitadel h2 {
  min-height: 48px;
  display: flex;
  align-items: center;
  font-size: clamp(1.5rem, 1rem + 1.6vw, 2.4rem);
}

.vitadel .lede {
  clear: left;
  margin-top: 18px;
}

/* Elwing: a web app with no device picture, so its macOS icon stands alone */

.elwing {
  justify-items: center;
  text-align: center;
}

.elwing .app-icon {
  width: clamp(144px, 22vh, 208px);
  margin-bottom: 4px;
}

.elwing .lede {
  max-width: 22em;
}

.elwing .links {
  justify-content: center;
}

/* Contact */

.contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 40px 64px;
  padding-block: clamp(64px, 12vh, 128px) 40px;
  border-top: 1px solid var(--line);
}

.contact h2 {
  font-size: clamp(1.75rem, 1rem + 2.4vw, 3rem);
  line-height: 1.05;
}

.email {
  display: inline-block;
  margin-top: 22px;
  font-family: var(--display);
  font-size: clamp(1.1rem, 0.6rem + 2.2vw, 2.3rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.social {
  display: flex;
  flex-wrap: wrap;
  gap: 0 28px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.social a {
  display: block;
  min-width: 24px;
  padding-block: 8px;
  text-align: center;
}

address {
  font-style: normal;
}

.legal {
  grid-column: 1 / -1;
  font-size: 15px;
}

/* Wide screens */

@media (min-width: 1800px) {
  :root {
    --wrap: 1480px;
  }
}

/* Tablets and phones: one column */

@media (max-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    min-height: 0;
    padding-bottom: 64px;
  }

  .gems {
    order: -1;
    max-width: 420px;
    aspect-ratio: 16 / 9;
  }

  .gem-a {
    top: 12%;
    left: 10%;
    width: 40%;
  }

  .gem-b {
    top: 0;
    left: 64%;
    width: 27%;
  }

  .gem-c {
    top: 41%;
    left: 54%;
    width: 33%;
  }

  .product {
    padding-block: 64px;
  }

  .auri,
  .voz,
  .vitadel,
  .siaru .head,
  .contact {
    grid-template-columns: minmax(0, 1fr);
  }

  .voz .shot {
    --max-h: 60svh;
  }

  .vitadel .shot {
    --max-h: 56svh;
  }
}

/* Phones: the pictures made for a phone screen */

@media (max-width: 760px) {
  .logo img {
    height: 42px;
  }

  .auri .shot {
    --ar: 580 / 650;
    --max-h: 64svh;
  }

  .siaru .shot {
    --ar: 900 / 1375;
    --max-h: 76svh;
  }
}

/* Where the list column is narrow, each name sits above what it is */

@media (min-width: 901px) and (max-width: 1180px), (max-width: 520px) {
  .index a {
    grid-template-columns: 32px minmax(0, 1fr);
    row-gap: 0;
    line-height: 1.35;
  }

  .index .what {
    grid-column: 2;
    font-size: 15px;
  }

  .index img {
    grid-row: span 2;
  }
}

/* 404 */

.missing {
  display: grid;
  justify-items: start;
  align-content: center;
  gap: 20px;
  min-height: calc(100svh - var(--bar) - 64px);
}

.missing-gem {
  width: clamp(120px, 20vh, 200px);
}

.missing h1 {
  font-size: clamp(2rem, 1rem + 3vw, 3.6rem);
  line-height: 1.05;
}
