/* The website of LOGIT. Colours follow the app: black (the app is dark only) and its lime accent; each screen of the
   home page brings the keyword colour of its App Store screenshot (fastlane/screenshots/Framefile.json in the app).
   No fonts, scripts or images from other servers. */

@property --accent {
  syntax: "<color>";
  inherits: true;
  initial-value: #BBFC4F;
}

:root {
  color-scheme: dark;
  --bg: #000;
  --text: #F5F5F7;
  --text-2: #A1A1A8;
  --text-3: #6E6E76;
  --line: rgba(255, 255, 255, 0.1);
  --surface: rgba(255, 255, 255, 0.045);
  --surface-hover: rgba(255, 255, 255, 0.08);
  --lime: #BBFC4F;
  --accent: var(--lime);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 1.6 -0.3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@supports (color: color(display-p3 1 1 1)) {
  :root { --lime: color(display-p3 0.729 0.987 0.31); }
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* A fine grain over everything, so the soft light doesn't band. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  opacity: 0.05;
  background-image: var(--noise);
}

a { color: inherit; }
img { display: block; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 4px; border-radius: 8px; }

.store-badge { display: inline-block; flex: none; border-radius: 10px; transition: filter 0.15s ease-out, transform 0.15s ease-out; }
.store-badge img { width: auto; height: 52px; }
.store-badge:hover { filter: brightness(1.25); }
.store-badge:active { transform: scale(0.97); }

/* Footer */

.footer {
  position: relative;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 24px;
  padding: 18px clamp(20px, 6vw, 112px) 22px;
  font-size: 13px;
  color: var(--text-3);
}

.footer nav { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.footer a { text-decoration: none; transition: color 0.15s ease-out; }
.footer a:hover, .footer a[aria-current="page"] { color: var(--text); }

@media (max-width: 700px) {
  .footer { flex-direction: column-reverse; justify-content: center; gap: 6px; text-align: center; }
  .footer nav { justify-content: center; }
}

/* ------------------------------------------------------------------------------------------------------------ */
/* The home page: one screen, no scrolling. It turns like a carousel: the icon and the App Store badge stay, the
   words, the iPhones and the colour around them change, by themselves every few seconds or with a swipe. */

.home {
  --pad: clamp(24px, 7vw, 128px);
  --copy: clamp(380px, 22vw + 140px, 540px);
  --ease: cubic-bezier(0.65, 0, 0.35, 1);
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  transition: --accent 1.2s ease;
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
}

/* Too short for one screen (a phone on its side): let it scroll rather than cut off the text. */
@media (max-height: 520px) {
  .home { height: auto; min-height: 100svh; overflow: visible; }
}

/* Soft light in the colour of the screen on show. */
.home::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle max(55vw, 560px) at 0% -10%, color-mix(in srgb, var(--accent) 6%, transparent), transparent 70%),
    radial-gradient(circle max(40vw, 420px) at 100% 110%, color-mix(in srgb, var(--accent) 4%, transparent), transparent 70%);
}

.home .footer::before {
  content: "";
  position: absolute;
  inset: -70px 0 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(to top, #000 45%, transparent);
}

.hero { position: relative; z-index: 2; display: flex; min-height: 0; }

/* The words */

.copy {
  flex: none;
  align-self: center;
  width: calc(var(--copy) + var(--pad));
  padding: 24px 0 24px var(--pad);
}

.app-icon {
  width: clamp(80px, 3vw + 52px, 108px);
  height: auto;
  border-radius: 22.5%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 18px 60px color-mix(in srgb, var(--accent) 14%, transparent);
}

.slides { display: grid; margin-top: 26px; }

.slide { grid-area: 1 / 1; align-self: start; opacity: 0; pointer-events: none; }
.slide.is-active { opacity: 1; pointer-events: auto; }

.slide h1, .slide h2 {
  margin: 0;
  font-size: clamp(56px, 6.2vw, 104px);
  line-height: 0.9;
  font-weight: 900;
  letter-spacing: -0.035em;
}

.slide h2 { font-size: clamp(46px, 5vw, 84px); letter-spacing: -0.025em; color: var(--c); }

.kicker {
  margin: 16px 0 0;
  font-size: clamp(17px, 0.6vw + 13px, 22px);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--lime);
}

.title {
  margin: 14px 0 0;
  font-size: clamp(24px, 1vw + 15px, 32px);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.lead {
  margin: 16px 0 0;
  max-width: 440px;
  font-size: clamp(17px, 0.4vw + 13px, 20px);
  line-height: 1.45;
  color: var(--text-2);
  text-wrap: pretty;
}

.lead strong { color: var(--text); font-weight: 600; }

.cta { display: flex; align-items: center; gap: 18px; margin-top: 34px; }
.cta p { margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--text-3); }
.cta p b { display: block; color: var(--text-2); font-weight: 600; }

/* Where we are: one bar per screen, the current one filling up until the next comes. */
.progress { display: flex; align-items: center; gap: 6px; margin-top: 30px; }

.progress button {
  position: relative;
  width: 28px;
  height: 20px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.progress button::before, .progress button span {
  content: "";
  position: absolute;
  inset: 8px 0 auto;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.16);
  transition: background-color 0.2s ease-out;
}

.progress button:hover::before { background: rgba(255, 255, 255, 0.32); }
.progress button span { background: var(--accent); transform: scaleX(0); transform-origin: left; }

.progress .toggle { width: 20px; margin-left: 6px; color: var(--text-3); transition: color 0.15s ease-out; }
.progress .toggle::before { content: none; }
.progress .toggle:hover { color: var(--text); }
.progress .toggle svg { display: block; width: 12px; height: 12px; margin: auto; fill: currentColor; }
.progress .toggle .play, .progress .toggle[aria-pressed="true"] .pause { display: none; }
.progress .toggle[aria-pressed="true"] .play { display: block; }

/* Without the script there's nothing to step through: the first screen stays. */
.no-js .progress { display: none; }

/* The iPhones: the one on show in front, its neighbours turned towards it. */

.stage {
  --w: min(calc((100cqh - 56px) / 1.925), calc(100cqw / 2.05), 430px);
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  container-type: size;
  perspective: 1800px;
  cursor: grab;
}

.stage:active { cursor: grabbing; }
.no-js .stage { cursor: auto; }

.stage::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -10%;
  width: calc(var(--w) * 3.4);
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 17%, transparent) 0%,
    color-mix(in srgb, var(--accent) 5%, transparent) 40%, transparent 68%);
}

.phone {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: var(--w);
  height: calc(var(--w) * 1.925);
  margin-left: calc(var(--w) * -0.5);
  overflow: hidden;
  transform-origin: 50% 100%;
  transform: translateX(var(--x, 0)) scale(var(--s, 1)) rotateY(var(--r, 0deg));
  opacity: var(--o, 1);
  filter: brightness(var(--b, 1));
  z-index: var(--z, 3);
  transition: transform 0.9s var(--ease), opacity 0.9s var(--ease), filter 0.9s var(--ease);
  /* The screenshots end just above the bottom of the iPhone: fade out before that. */
  -webkit-mask-image: linear-gradient(to bottom, #000 88%, transparent 98%);
  mask-image: linear-gradient(to bottom, #000 88%, transparent 98%);
}

.phone img { display: block; width: 100%; height: auto; -webkit-user-drag: none; }

.phone[data-pos="-1"], .phone[data-pos="1"] { --s: 0.8; --b: 0.5; --z: 2; cursor: pointer; }
.phone[data-pos="-1"] { --x: calc(var(--w) * -0.62); --r: 24deg; }
.phone[data-pos="1"] { --x: calc(var(--w) * 0.62); --r: -24deg; }
.phone[data-pos="-2"], .phone[data-pos="-3"] { --x: calc(var(--w) * -1.05); --s: 0.62; --r: 40deg; --o: 0; --b: 0.3; --z: 1; }
.phone[data-pos="2"], .phone[data-pos="3"] { --x: calc(var(--w) * 1.05); --s: 0.62; --r: -40deg; --o: 0; --b: 0.3; --z: 1; }

/* Narrow windows and phones: the words on top, the iPhones below them. */
@media (max-width: 960px), (max-aspect-ratio: 1/1) {
  .hero { flex-direction: column; }
  .copy { display: flex; flex-direction: column; align-items: center; align-self: stretch; width: auto; padding: clamp(24px, 5svh, 64px) 20px 0; text-align: center; }
  .app-icon { width: clamp(56px, 7svh, 84px); }
  .slides { margin-top: clamp(14px, 2.4svh, 24px); }
  .slide h1 { font-size: clamp(50px, 14vw, 84px); }
  .slide h2 { font-size: clamp(44px, 12vw, 76px); }
  .kicker { margin-top: 12px; }
  .title { margin-top: 10px; font-size: clamp(21px, 5.4vw, 30px); }
  .lead { margin: 12px auto 0; font-size: 16px; }
  .cta { flex-direction: column; gap: 10px; margin-top: clamp(18px, 3svh, 30px); }
  .cta p { display: none; }
  .progress { margin-top: clamp(10px, 2svh, 22px); }
  .stage { --w: min(calc((100cqh - 24px) / 1.925), calc(100cqw / 1.7), 400px); min-height: 180px; margin-top: 8px; }
  .phone[data-pos="-1"] { --x: calc(var(--w) * -0.7); }
  .phone[data-pos="1"] { --x: calc(var(--w) * 0.7); }
}

@media (max-width: 960px) and (max-height: 900px), (max-aspect-ratio: 1/1) and (max-height: 900px) {
  .slide .lead { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .home, .phone { transition-duration: 0.01s; }
}

/* ------------------------------------------------------------------------------------------------------------ */
/* Text pages: contact, privacy, terms, legal notice. */

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 22px clamp(20px, 5vw, 48px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.brand img { width: 36px; height: 36px; border-radius: 9px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12); }
.top .store-badge img { height: 40px; }

/* The footer stays at the bottom of the window on short pages. */
body:not(.home) { display: flex; flex-direction: column; min-height: 100vh; min-height: 100svh; }
.top, .doc, .doc + .footer { width: 100%; }

/* A trace of the lime light at the top of the page. */
body:not(.home)::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 520px;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse 70% 100% at 50% -30%, color-mix(in srgb, var(--lime) 8%, transparent), transparent 70%);
}

.doc {
  flex: 1 0 auto;
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(28px, 7vh, 72px) 20px 56px;
}

.doc h1 {
  margin: 0;
  font-size: clamp(38px, 5vw, 56px);
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: -0.035em;
}

.doc .intro { margin: 18px 0 0; font-size: 19px; line-height: 1.55; color: var(--text-2); text-wrap: pretty; }
.doc .updated { margin: 14px 0 0; font-size: 13px; color: var(--text-3); }

.doc h2 {
  margin: 48px 0 0;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  font-size: 21px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.015em;
  scroll-margin-top: 24px;
}

.doc h3 { margin: 30px 0 0; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; scroll-margin-top: 24px; }
.doc h4 { margin: 22px 0 0; font-size: 15px; font-weight: 700; color: var(--text); }

.doc p, .doc ul, .doc ol, .doc address { margin: 12px 0 0; color: var(--text-2); }
.doc address { font-style: normal; }
.doc ul, .doc ol { padding-left: 22px; }
.doc li { margin: 6px 0 0; padding-left: 4px; }
.doc li::marker { color: var(--text-3); }
.doc strong { color: var(--text); font-weight: 600; }
.doc em { font-style: italic; }

.doc a { color: var(--lime); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--lime) 40%, transparent); text-underline-offset: 3px; overflow-wrap: anywhere; }
.doc a:hover { text-decoration-color: var(--lime); }

.doc .table { margin: 16px 0 0; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.doc table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.45; }
.doc th, .doc td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; color: var(--text-2); }
.doc th { color: var(--text); font-weight: 600; background: var(--surface); }
.doc tr:last-child td { border-bottom: 0; }

/* Contact: ways to get in touch. */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 32px 0 0; }

.doc .card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 18px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: background-color 0.15s ease-out;
}

.doc .card:hover { background: var(--surface-hover); }
.card svg { width: 22px; height: 22px; margin-bottom: 10px; fill: none; stroke: var(--lime); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.card b { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.card span { font-size: 13.5px; line-height: 1.45; color: var(--text-3); overflow-wrap: anywhere; }

/* Contact: questions that fold open. */
.faq { margin: 16px 0 0; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }

.faq summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 2px;
  font-weight: 600;
  letter-spacing: -0.01em;
  list-style: none;
  cursor: pointer;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  margin-right: 4px;
  border-right: 1.6px solid var(--text-3);
  border-bottom: 1.6px solid var(--text-3);
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.2s ease-out;
}

.faq details[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.faq details > :not(summary) { margin: 0 2px; }
.faq details > :last-child { padding-bottom: 18px; }

.doc + .footer { max-width: 760px; margin: 0 auto; padding-left: 20px; padding-right: 20px; border-top: 1px solid var(--line); }

@media (max-width: 520px) {
  .top .store-badge img { height: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01s !important; }
}
