/* ==========================================================================
   Roolo — quiet, single-screen site
   A centered Arial column, a warm sand brush, and generous air.
   ========================================================================== */

:root {
  color-scheme: light;
  --color-sand-100: #f4efec;
  --color-sand-400: #e1d5cd;
  --color-sand-500: #d3c3b8;
  --color-onyx: #1f2322;
  --color-soot-400: #585254;
  --font-serif: Arial, Helvetica, sans-serif;
  --font-sans: Arial, Helvetica, sans-serif;
  --home-text: 24px;
  --home-leading: 1.3;
  --home-gap: 1.9em;
  --home-column: 41rem;
  --page-gutter: 16px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  background: #fff;
}

body {
  margin: 0;
  background: #fff;
  color: var(--color-onyx);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
}

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

a {
  color: inherit;
  text-decoration: inherit;
}

::selection {
  background: var(--color-sand-100);
  color: var(--color-onyx);
  text-shadow: none;
}

.marketing-site {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  background: #fff;
  color: var(--color-onyx);
  font-family: var(--font-sans);
}

.marketing-site--home {
  padding: var(--page-gutter);
}

.marketing-site :where(h1, h2, h3, p, ul, ol, li) {
  margin: 0;
  padding: 0;
}

.marketing-site :where(ol, ul) {
  list-style: none;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--page-gutter);
  z-index: 300;
  padding: 10px 14px;
  border-radius: 4px;
  background: var(--color-onyx);
  color: #fff;
  font-size: 13px;
  line-height: 1.2;
  transition: top 0.18s var(--ease-out);
}

.skip-link:focus {
  top: var(--page-gutter);
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-onyx);
  outline-offset: 5px;
}

/* The skip link focuses <main>, but it is not an interactive control. Chrome
   can otherwise draw its page-wide UA outline after selecting text and
   pressing Shift. */
main:focus,
main:focus-visible {
  outline: none;
}

/* ── Header ───────────────────────────────────────────────────────────── */

.site-header {
  position: relative;
  z-index: 10;
  flex-shrink: 0;
  padding: 20px var(--page-gutter);
}

.site-header__home {
  display: block;
  width: fit-content;
  border-radius: 50%;
  transition: transform 0.25s ease;
}

@media (hover: hover) {
  .site-header__home:hover {
    transform: scale(1.05);
  }
}

.site-header__home:active {
  transform: scale(0.97);
}

/* The app's chat face, at header scale. Geometry follows the 76px app orb,
   with a 2px minimum on the smile so it stays legible when small. */
.face-orb {
  --eye-w: 0.1184em;
  --eye-h: 0.1184em;
  --eye-r: 50%;
  --eye-y: 0px;
  --blink-open: 1;
  position: relative;
  display: block;
  width: 1em;
  height: 1em;
  font-size: 72px;
  border-radius: 50%;
  isolation: isolate;
}

.face-orb__spin {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 200deg,
    #7c5cff,
    #3aa0ff,
    #5dffb0,
    #ffe566,
    #ff8a4c,
    #ff5ad1,
    #7c5cff
  );
  animation: rooloOrbSpin 14s linear infinite;
  box-shadow: inset 0 0 0.368em rgba(255, 255, 255, 0.28);
}

.face-orb__shine {
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  background: radial-gradient(
    circle at 32% 28%,
    rgba(255, 255, 255, 0.62),
    transparent 58%
  );
  pointer-events: none;
  z-index: 1;
}

.face-orb__face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  animation: rooloFaceGlance 7.2s ease-out infinite;
  transform-origin: 50% 55%;
}

.face-orb__eyes {
  position: absolute;
  top: 39%;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.1974em;
  transform: translate(-50%, var(--eye-y));
}

.face-orb__eye {
  width: var(--eye-w);
  height: var(--eye-h);
  border-radius: var(--eye-r);
  background: #fff;
  transform: scaleY(var(--blink-open));
  transform-origin: 50% 50%;
  transition: transform 0.08s ease;
}

.face-orb__mouth {
  position: absolute;
  top: 63%;
  left: 50%;
  width: 0.1842em;
  height: 0.0263em;
  border: 0 solid #fff;
  border-bottom-width: 2px;
  border-radius: 0.0526em;
  background: transparent;
  transform: translateX(-50%);
}

@keyframes rooloOrbSpin {
  to { transform: rotate(360deg); }
}

@keyframes rooloFaceGlance {
  0%, 21%, 100% { transform: translate(0, 0) rotate(0); }
  25%, 46% { transform: translate(-0.0526em, -0.0132em) rotate(-3deg); }
  50%, 71% { transform: translate(0, 0) rotate(0); }
  75%, 96% { transform: translate(0.0526em, 0.0132em) rotate(3deg); }
}

@media (prefers-reduced-motion: reduce) {
  .face-orb__spin,
  .face-orb__face {
    animation: none;
  }

  .face-orb__eye {
    transition: none;
  }
}

@media (min-width: 80rem) {
  .site-header {
    padding: 20px 20px 0;
  }

  .face-orb {
    font-size: 84px;
  }
}

/* ── Arrival reveal ───────────────────────────────────────────────────── */

.js-reveal:not(.is-revealed) .reveal {
  opacity: 0;
}

.js-reveal.is-revealed .reveal {
  animation: home-reveal 0.6s var(--ease-out) calc(var(--reveal, 0) * 90ms) both;
}

@keyframes home-reveal {
  from {
    opacity: 0;
    translate: 0 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .js-reveal.is-revealed .reveal {
    animation: home-reveal-fade 0.3s both;
  }

  @keyframes home-reveal-fade {
    from { opacity: 0; }
  }
}

/* ── Home ─────────────────────────────────────────────────────────────── */

.home {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  padding: 32px var(--page-gutter) 20px;
  background: #fff;
  scrollbar-color: var(--color-sand-500) transparent;
  scrollbar-width: thin;
  scrollbar-gutter: stable both-edges;
}

.home::-webkit-scrollbar {
  width: 6px;
}

.home::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--color-sand-500);
}

.home::-webkit-scrollbar-track {
  background: transparent;
}

.home__wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.home__intro {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--home-gap);
  width: 100%;
  max-width: var(--home-column);
  font-size: var(--home-text);
  line-height: var(--home-leading);
  letter-spacing: -0.01em;
}

.home__intro > h1,
.home__intro > p,
.home__prompt {
  width: 100%;
  max-width: var(--home-column);
  font-family: var(--font-serif);
  font-weight: 400;
  text-wrap: pretty;
  text-box: trim-both cap alphabetic;
}

.home__intro h1 {
  font-size: inherit;
  font-weight: 600;
  line-height: inherit;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

/* Keep the home story on one centered axis without changing legal pages. */
.marketing-site--home .site-header__home {
  margin-inline: auto;
}

.marketing-site--home .home__intro {
  align-items: center;
  text-align: center;
}

.marketing-site--home .home__actions {
  align-items: center;
}

.marketing-site--home > .legal-links {
  justify-content: center;
  text-align: center;
}

.marketing-site--home .legal-links__nav {
  justify-content: center;
}

.demo {
  width: 100%;
  margin: 0;
}

.demo__screen {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--color-sand-400);
  border-radius: 20px;
  background: radial-gradient(ellipse at 25% 10%, #e1d5cd 0%, transparent 60%), #f4efec;
}

.demo__screen video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #1f2322;
}

.demo [hidden] { display: none; }

.demo__play {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 100%;
  height: 100%;
  padding: 24px;
  border: 0;
  background: linear-gradient(#0006, #0008), url("/images/roolo-demo-poster.webp") center / cover no-repeat;
  color: #fff;
  font: 600 clamp(16px, 3vw, 21px) / 1.4 var(--font-sans);
  cursor: pointer;
  text-align: left;
}

.demo__play:focus-visible { outline-offset: -6px; border-radius: inherit; }
.demo__play small { display: block; margin-top: 4px; color: #fff; font-size: 13px; font-weight: 400; }
.demo__play-icon { display: grid; place-items: center; flex: 0 0 56px; height: 56px; border: 1px solid var(--color-sand-500); border-radius: 50%; background: #fff; color: var(--color-onyx); transition: transform .2s var(--ease-out); }
.demo__play:hover .demo__play-icon { transform: scale(1.06); }
.demo__error, .demo__fallback { padding-top: 12px; font: 400 14px / 1.5 var(--font-sans); }
.demo__error a, .demo__fallback a { text-decoration: underline; text-underline-offset: 3px; }
.home__download { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.download-button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; padding: 14px 24px; border: 1px solid var(--color-sand-400); border-radius: 999px; background: var(--color-sand-100); color: var(--color-onyx); font: 600 15px / 1.4 var(--font-sans); }
.download-button:disabled { cursor: not-allowed; }
.home__download p { color: var(--color-soot-400); font: 400 13px / 1.5 var(--font-sans); }

/* ── Actions: text CTAs with a painted underline ──────────────────────── */

.home__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  max-width: var(--home-column);
}

.home__ctas {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cta {
  font-family: var(--font-serif);
  font-size: var(--home-text);
  font-weight: 600;
  line-height: var(--home-leading);
  letter-spacing: -0.01em;
  color: var(--color-onyx);
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.cta__label {
  position: relative;
  isolation: isolate;
}

.cta__label::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: auto 0 0.13em;
  height: 0.42em;
  background-color: var(--color-sand-400);
  -webkit-mask: url("/images/brush.svg") center / 100% 100% no-repeat;
  mask: url("/images/brush.svg") center / 100% 100% no-repeat;
  scale: 1.05;
  transition: background-color 0.15s;
}

.js-reveal.is-revealed .cta__label::before {
  animation: brush-draw 0.7s cubic-bezier(0.33, 1, 0.68, 1) calc(var(--reveal, 0) * 90ms + 0.25s) both;
}

@keyframes brush-draw {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0); }
}

@media (hover: hover) {
  .cta:hover .cta__label::before {
    background-color: var(--color-sand-500);
  }
}

.cta__chevron {
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  margin-left: 0.1em;
  vertical-align: -0.2em;
}

.cta__chevron svg {
  display: block;
  width: 100%;
  height: 100%;
}

@media (prefers-reduced-motion: reduce) {
  .js-reveal.is-revealed .cta__label::before {
    animation: none;
  }
}

/* ── Footer ───────────────────────────────────────────────────────────── */

.legal-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  width: 100%;
  color: var(--color-onyx);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.01em;
}

.legal-links__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
}

.legal-links__nav a {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  white-space: nowrap;
}

@media (hover: hover) {
  .legal-links__nav a:hover {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: calc(0.1em + 1px);
  }
}

.legal-links__nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: calc(0.1em + 1px);
}

/* A single page scroll moves the face and footer with the rest of the story. */
.marketing-site--home > .legal-links {
  flex-shrink: 0;
  margin-top: 40px;
  margin-bottom: 20px;
  padding-inline: var(--page-gutter);
}

/* ── Legal pages ──────────────────────────────────────────────────────── */

.legal-page {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 20px var(--page-gutter);
  background: #fff;
}

.back-button,
.legal,
.legal-page__links {
  width: 100%;
  max-width: 49.5rem;
  margin-inline: auto;
}

.back-button {
  display: flex;
  align-items: center;
  margin-bottom: 32px;
}

.back-button a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  color: var(--color-onyx);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.2;
  text-decoration: none;
}

@media (hover: hover) {
  .back-button a:hover {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: calc(0.1em + 1px);
  }
}

.back-button svg {
  width: 1.1em;
  height: 1.1em;
}

.legal {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.legal__section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.legal h1 {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.legal__revised {
  color: var(--color-soot-400);
}

.legal h2,
.legal h3 {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: -0.005em;
}

.legal p,
.legal li {
  color: var(--color-onyx);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.005em;
  text-wrap: pretty;
}

.legal p.legal__revised {
  color: var(--color-soot-400);
}

.legal ul,
.legal ol {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-left: 16px;
}

.legal ul {
  list-style: disc;
}

.legal ol {
  list-style: decimal;
}

.legal strong {
  font-weight: 600;
}

.legal a:not(.cta) {
  text-decoration: underline;
  text-decoration-color: rgba(31, 35, 34, 0.35);
  text-decoration-thickness: 1px;
  text-underline-offset: calc(0.1em + 1px);
}

@media (hover: hover) {
  .legal a:not(.cta):hover {
    color: var(--color-onyx);
    text-decoration-color: var(--color-onyx);
  }
}

.legal-page__links {
  margin-top: auto;
  padding-top: 96px;
}

/* ── Responsive details ───────────────────────────────────────────────── */

@media (min-width: 80rem) {
  .home {
    padding: 64px 20px 20px;
  }

  .marketing-site--home > .legal-links {
    padding-inline: 20px;
  }
}

@media (max-width: 47.9375rem) {
  .legal-page {
    padding: 16px var(--page-gutter) 20px;
  }

  .legal-page__links {
    padding-top: 64px;
  }
}

@media (max-width: 33.75rem) {
  .legal-links__copyright {
    flex-basis: 100%;
  }
}

/* ── Preferences ──────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (forced-colors: active) {
  .cta__label::before {
    display: none;
  }

  .face-orb__spin {
    background: CanvasText;
    box-shadow: none;
  }

  .face-orb__shine {
    display: none;
  }

  .face-orb__eye {
    background: Canvas;
  }

  .face-orb__mouth {
    border-color: Canvas;
  }
}

@media print {
  .marketing-site {
    min-height: 0;
  }

  .marketing-site--home {
    height: auto;
    overflow: visible;
  }

  .home {
    overflow: visible;
  }

  .marketing-site--home > .legal-links {
    margin-bottom: 0;
  }

  .skip-link,
  .back-button {
    display: none;
  }

  .legal-page {
    padding: 0;
  }

  .legal-page__links {
    padding-top: 32px;
  }
}
