/*
 * gleams.gr. The app's own world carried onto the web: near black, the
 * faces carry the colour, one filled light button per view, the AI badge in
 * indigo. Type is Commissioner, drawn by the Greek type designer Kostas
 * Bartsokas, with its flair axis opened for display and closed for reading.
 */

@font-face {
  font-family: "Commissioner";
  src: url("/assets/fonts/commissioner-greek.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: "Commissioner";
  src: url("/assets/fonts/commissioner-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  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 {
  color-scheme: dark;
  --bg: #141414;
  --surface: #1c1c1c;
  --raised: #2c2c2e;
  --rim: #3f3f42;
  --line: #2a2a2c;
  --text: #f5f5f7;
  --soft: #b4b4ba;
  --muted: #8e8e93;
  --bot-bubble: #212121;
  --user-bubble: #2c2c2e;
  --primary: #f5f5f7;
  --on-primary: #0a0a0b;
  --ai-bg: #312e81;
  --ai-text: #c7d2fe;
  --ink: #1b1d2a;
  --sun: #ffc83d;
  --sun-deep: #f2a91c;
  --sun-soft: #5b4511;
  --focus: #9ea6ff;

  --r-bubble: 22px;
  --r-surface: 28px;
  --r-pill: 999px;

  --gutter: clamp(16px, 4.5vw, 56px);
  --max: 1240px;
  --read: 68ch;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --display: "Commissioner", system-ui, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--display);
  font-size: 1.125rem;
  line-height: 1.6;
  font-variation-settings: "FLAR" 0, "VOLM" 0;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

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

a {
  color: inherit;
}

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

h1,
h2,
h3 {
  margin: 0;
  font-weight: 760;
  font-variation-settings: "FLAR" 100, "VOLM" 40;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 30;
  padding: 10px 16px;
  border-radius: var(--r-pill);
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 650;
  text-decoration: none;
}
.skip:focus {
  top: 12px;
}

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

/* Buttons: one filled light pill per view, as in the app. */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 26px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font: inherit;
  font-weight: 650;
  font-size: 1.0625rem;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s var(--ease-out), background-color 0.2s, border-color 0.2s;
}
.btn:active {
  transform: translateY(1px) scale(0.98);
}
.btn svg {
  width: 20px;
  height: 20px;
  flex: none;
}
.btn--primary {
  background: var(--primary);
  color: var(--on-primary);
}
.btn--primary:hover {
  background: #ffffff;
}
.btn--ghost {
  border-color: var(--rim);
  color: var(--text);
  background: transparent;
}
.btn--ghost:hover {
  border-color: #6b6b70;
  background: var(--surface);
}
.btn--small {
  min-height: 42px;
  padding: 0 18px;
  font-size: 0.9375rem;
}

.ai {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: var(--r-pill);
  background: var(--ai-bg);
  color: var(--ai-text);
  font-size: 0.6875rem;
  font-weight: 750;
  line-height: 1.6;
  letter-spacing: 0.02em;
  vertical-align: middle;
  font-variation-settings: "FLAR" 0, "VOLM" 0;
}

.text-link {
  color: var(--text);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: #6b6b70;
  text-underline-offset: 4px;
  text-decoration-thickness: 1.5px;
}
.text-link:hover {
  text-decoration-color: currentColor;
}

/* Header */

.site-head {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
.site-head.is-stuck {
  border-color: var(--line);
}
/* The header's invite waits while another one is already on screen. */
.site-head__cta {
  transition: opacity 0.3s, visibility 0.3s;
}
.site-head__cta.is-quiet {
  opacity: 0;
  visibility: hidden;
}
.site-head__bar {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 68px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 760;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  font-variation-settings: "FLAR" 100, "VOLM" 40;
}
.brand .face {
  --size: 34px;
}

/* The header's lockup: the wordmark, and under it the maker's signature,
   in English on purpose. Two links side by side, so the face spans both
   rows of a grid the home link shares with the signature through subgrid. */
.lockup {
  display: grid;
  grid-template-columns: 34px auto;
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-content: center;
  min-width: 0;
}
.lockup .brand {
  grid-area: 1 / 1 / 3 / 3;
  display: grid;
  grid-template-columns: subgrid;
  grid-template-rows: subgrid;
}
.lockup .brand .face {
  grid-column: 1;
  grid-row: 1 / 3;
  align-self: center;
}
.brand__name {
  grid-column: 2;
  grid-row: 1;
  align-self: end;
  line-height: 1.1;
}
.signature {
  position: relative;
  grid-column: 2;
  grid-row: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 0.3em;
  min-height: 24px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 450;
  line-height: 1.25;
  letter-spacing: 0;
  text-decoration: none;
  font-variation-settings: "FLAR" 0, "VOLM" 0;
}
.signature span,
.signature em {
  white-space: nowrap;
}
.signature em {
  font-style: normal;
  font-weight: 600;
  color: var(--soft);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: color 0.2s, text-decoration-color 0.2s;
}
.signature:hover em {
  color: var(--text);
  text-decoration-color: currentColor;
}
@media (max-width: 640px) {
  .site-head__bar {
    gap: 16px;
  }
  .signature {
    font-size: 0.6875rem;
  }
}
.nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.nav a {
  padding: 8px 14px;
  border-radius: var(--r-pill);
  color: var(--soft);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 550;
}
.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--text);
  background: var(--surface);
}
.menu {
  display: none;
  margin-left: auto;
  position: relative;
}
.menu summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--rim);
  border-radius: var(--r-pill);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9375rem;
}
.menu summary::-webkit-details-marker {
  display: none;
}
.menu[open] summary {
  background: var(--surface);
}
.menu__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  display: grid;
  min-width: 230px;
  padding: 8px;
  border: 1px solid var(--rim);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 18px 40px rgb(0 0 0 / 0.45);
}
.menu__panel a {
  padding: 12px 14px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 550;
}
.menu__panel a:hover {
  background: var(--raised);
}

@media (max-width: 860px) {
  .nav {
    display: none;
  }
  .menu {
    display: block;
  }
  .site-head__cta {
    display: none;
  }
}

/* The conversation grammar every section speaks: the visitor asks, on the
   right in the user's bubble, and Gleams answers on the left with its face. */

.ask {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 26px;
}
.ask span {
  max-width: min(30ch, 82%);
  padding: 12px 18px;
  border-radius: var(--r-bubble) var(--r-bubble) 6px var(--r-bubble);
  background: var(--user-bubble);
  font-size: 1.0625rem;
  line-height: 1.45;
}
.answer {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: start;
}
.answer > .face {
  --size: 48px;
  margin-top: 4px;
}
.answer h2 {
  font-size: clamp(2rem, 4.4vw, 3.4rem);
  line-height: 1.04;
}
.lede {
  margin-top: 18px;
  max-width: 56ch;
  color: var(--soft);
  font-size: clamp(1.125rem, 1.6vw, 1.25rem);
}

/* Faces. Drawn by site.js from the app's own shapes and palette. */

.face {
  --size: 64px;
  position: relative;
  display: inline-block;
  flex: none;
  width: var(--size);
  height: var(--size);
}
.face svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.f-gaze {
  transform: translate(calc(var(--gx, 0) * 6px), calc(var(--gy, 0) * 4.5px));
  transition: transform 0.45s var(--ease-out);
}
.f-eye {
  transform-box: fill-box;
  transform-origin: center;
  animation: blink var(--blink, 5s) infinite;
  animation-delay: var(--blink-delay, 0s);
}
.f-happy {
  opacity: 0;
}
.f-eyes,
.f-happy {
  transition: opacity 0.18s;
}
.face.is-poked .f-eyes {
  opacity: 0;
}
.face.is-poked .f-happy {
  opacity: 1;
}
.f-mouth-open {
  transform-box: fill-box;
  transform-origin: center;
}
.f-drop {
  opacity: 0;
}
.f-mouth-open {
  opacity: 0;
}
.face.is-talking .f-mouth-open {
  opacity: 1;
}
.face.is-talking .f-smile {
  opacity: 0;
}

@keyframes blink {
  0%,
  94%,
  100% {
    transform: scaleY(1);
  }
  96% {
    transform: scaleY(0.1);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .f-body {
    transform-box: view-box;
    transform-origin: 50px 94px;
    animation: breathe 3.4s ease-in-out infinite alternate;
    animation-delay: var(--breath-delay, 0s);
  }
  .f-glance {
    animation: glance var(--glance, 10s) ease-in-out infinite;
    animation-delay: var(--glance-delay, 0s);
  }
  .is-led .f-glance {
    animation: none;
  }
  .face.is-poked .f-body {
    animation: poke 0.75s var(--ease-out);
  }
  .face.is-talking .f-mouth-open {
    animation: talk 0.34s ease-in-out infinite alternate;
  }
  .face.is-born .f-body {
    animation: birth 1.1s var(--ease-out) both;
  }
  .face.is-born .f-gaze {
    animation: eyes-in 1.1s var(--ease-out) both;
  }
  .face.is-born .f-drop {
    animation: gather 1.1s var(--ease-out) both;
  }
}

@keyframes breathe {
  from {
    transform: none;
  }
  to {
    transform: translateY(-1.5px) scale(0.985, 1.035);
  }
}
@keyframes glance {
  0%,
  30%,
  48%,
  70%,
  88%,
  100% {
    transform: none;
  }
  34%,
  44% {
    transform: translate(-4px, -1px);
  }
  74%,
  84% {
    transform: translate(4px, 1.5px);
  }
}
@keyframes poke {
  0% {
    transform: none;
  }
  25% {
    transform: rotate(-7deg) scale(1.12, 0.88);
  }
  50% {
    transform: rotate(5deg) scale(0.92, 1.08);
  }
  75% {
    transform: rotate(-2deg) scale(1.03, 0.97);
  }
  100% {
    transform: none;
  }
}
@keyframes talk {
  from {
    transform: scaleY(0.3);
  }
  to {
    transform: scaleY(1);
  }
}
@keyframes birth {
  0%,
  34% {
    transform: scale(0.15);
    opacity: 0;
  }
  40% {
    opacity: 1;
  }
  62% {
    transform: scale(1.1);
  }
  78% {
    transform: scale(0.95);
  }
  100% {
    transform: none;
    opacity: 1;
  }
}
@keyframes eyes-in {
  0%,
  60% {
    opacity: 0;
    transform: translateX(30px);
  }
  86% {
    opacity: 1;
    transform: translateX(-3px);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}
@keyframes gather {
  0% {
    opacity: 0;
    transform: translate(var(--dx), var(--dy));
  }
  8% {
    opacity: 1;
  }
  34% {
    opacity: 1;
    transform: translate(calc(var(--dx) * 0.27), calc(var(--dy) * 0.27));
  }
  40%,
  100% {
    opacity: 0;
    transform: none;
  }
}

/* Arrival: content is visible by default, and only a script that is running
   and allowed to move hides it for its entrance. */

@media (prefers-reduced-motion: no-preference) {
  .js .arrive {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.7s var(--ease-out), transform 0.9s var(--ease-out);
    transition-delay: var(--delay, 0s);
  }
  .js .arrive.is-in {
    opacity: 1;
    transform: none;
  }
}

/* Phone screenshots, framed the way the app draws its own surfaces. */

.shot {
  margin: 0;
  border-radius: 34px;
  padding: 7px;
  background: #0b0b0c;
  border: 1px solid var(--rim);
  box-shadow: 0 30px 60px -20px rgb(0 0 0 / 0.7);
}
.shot img {
  width: 100%;
  height: auto;
  border-radius: 28px;
}

/* Footer */

.site-foot {
  margin-top: 40px;
  border-top: 1px solid var(--line);
  padding: 56px 0 40px;
  color: var(--soft);
  font-size: 1rem;
}
.foot-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 40px;
}
.foot-brand p {
  margin-top: 14px;
  max-width: 34ch;
}
.proud {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}
.proud svg {
  width: 16px;
  height: 16px;
}
.proud span {
  text-decoration: underline;
  text-decoration-color: #6b6b70;
  text-underline-offset: 4px;
}
.proud:hover span {
  text-decoration-color: currentColor;
}
.foot-col h2 {
  font-size: 0.9375rem;
  font-weight: 650;
  letter-spacing: 0;
  color: var(--text);
  font-variation-settings: "FLAR" 0, "VOLM" 0;
}
.foot-col ul {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.foot-col a {
  text-decoration: none;
}
.foot-col a:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.foot-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 32px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9375rem;
}

@media (max-width: 860px) {
  .foot-grid {
    grid-template-columns: 1fr 1fr;
  }
  .foot-brand {
    grid-column: 1 / -1;
  }
}

/* The invite bar that follows on a phone once the hero is gone. */

.dock {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 15;
  display: none;
}
@media (max-width: 860px) {
  .js .dock {
    display: block;
    transform: translateY(140%);
    transition: transform 0.45s var(--ease-out);
  }
  .js .dock.is-shown {
    transform: none;
  }
  .dock .btn {
    width: 100%;
    box-shadow: 0 12px 30px rgb(0 0 0 / 0.55);
  }
}

/* Pages that are read: the guide, the ideas and the legal texts. */

.page-head {
  padding: clamp(40px, 7vw, 88px) 0 clamp(28px, 4vw, 48px);
}
.page-head h1 {
  font-size: clamp(2.4rem, 5.6vw, 4.4rem);
  line-height: 1.02;
  max-width: 18ch;
}
.page-head .lede {
  margin-top: 20px;
}
.page-head .face-row {
  display: flex;
  gap: 10px;
  margin-bottom: 26px;
}
.page-head .face-row .face {
  --size: 44px;
}
