/* Sami Timer: the site. Colors and type follow the Sami brand (Night, Sky, Sami Green, Sun; Nunito for what is large). */

@font-face {
  font-family: "Nunito";
  src: url("fonts/nunito.woff2") format("woff2");
  font-weight: 200 1000;
  font-display: swap;
}

:root {
  --night: #1E2A5A;
  --night-deep: #161E42;
  --night-low: #24337A;
  --sky: #9CC5FF;
  --sky-pale: #DCEBFF;
  --green: #2FCB85;
  --sun: #FFC93C;
  --page: #F4F6FB;
  --display: "Nunito", ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  --gutter: clamp(20px, 5vw, 56px);
  --wide: 1200px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--page);
  color: var(--night);
  font: 1.0625rem/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
}
img, canvas { display: block; max-width: 100%; }
h1, h2, h3, p, figure { margin: 0; }
a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 0.09em; }
::selection { background: var(--sun); color: var(--night-deep); }
:focus-visible { outline: 3px solid var(--night); outline-offset: 3px; border-radius: 6px; }
.on-night :focus-visible { outline-color: var(--sun); }
html { scrollbar-color: var(--night) var(--sky-pale); }

.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; z-index: 10; background: #fff; padding: 8px 14px; border-radius: 10px; }

/* Top bar */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 22px; padding-bottom: 22px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 900 1.375rem/1 var(--display); text-decoration: none; color: var(--night-deep); }
.brand img { width: 40px; height: 40px; }
.lang { font: 800 0.9375rem/1 var(--display); padding: 12px 16px; margin-right: -16px; border-radius: 999px; }

/* The beginning: the sentence, the stores and the timer running */
.hero { background: var(--sky); color: var(--night-deep); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: clamp(28px, 6vw, 88px); align-items: center; padding-top: clamp(16px, 4vw, 48px); padding-bottom: clamp(56px, 8vw, 104px); }
.hero h1 { font: 900 clamp(2.75rem, 7vw, 6rem)/0.98 var(--display); letter-spacing: -0.025em; text-wrap: balance; max-width: 11ch; }
.hero .sub { font: 700 clamp(1.125rem, 1.9vw, 1.5rem)/1.35 var(--display); margin-top: 20px; max-width: 24ch; text-wrap: balance; }
/* The official store badges, unchanged; "coming soon" is said above them, and they lead nowhere until the app is out. */
.soon { margin-top: 32px; font: 800 1rem/1.2 var(--display); }
.stores { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 12px 0 0; padding: 0; list-style: none; }
.stores img { height: 54px; width: auto; }

.demo { display: grid; justify-items: center; gap: 18px; }
.device { width: clamp(248px, min(27vw, 34svh), 344px); aspect-ratio: 300 / 600; padding: 10px; border-radius: 52px; background: var(--night-deep); box-shadow: 0 34px 60px -30px rgba(22, 30, 66, 0.7), 0 10px 22px -12px rgba(22, 30, 66, 0.45); }
.screen { position: relative; height: 100%; border-radius: 42px; overflow: hidden; background: var(--bg, var(--sky)); color: var(--ink, var(--night-deep)); transition: background 0.7s var(--ease), color 0.7s var(--ease); display: grid; grid-template-rows: 1fr auto; }
.stage { position: relative; margin: 14% 4% 0; }
.stage img, .stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.stage canvas { opacity: 0; transition: opacity 0.4s var(--ease); }
.is-live .stage canvas { opacity: 1; }
/* The still picture breathes while the animation loads, and leaves only after the animation has faded in over it. */
.is-loading .stage img, .is-loading .tile img { animation: wait 1.1s ease-in-out infinite alternate; }
.is-live .stage img, .is-live .tile img { animation: none; visibility: hidden; transition: visibility 0s 0.4s; }
@keyframes wait { from { opacity: 1; } to { opacity: 0.55; } }
.left { text-align: center; padding: 0 12px 16%; font: 700 0.875rem/1.2 var(--body); }
.left b { display: block; font: 900 clamp(2rem, 3.4vw, 2.75rem)/1.05 var(--display); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; margin-top: 2px; }
.try { display: grid; justify-items: center; gap: 10px; }
.try p { font: 700 0.9375rem/1.3 var(--body); }
.chips { display: flex; gap: 8px; }
.chips button { min-width: 72px; min-height: 48px; padding: 0 18px; border-radius: 999px; border: 2px solid var(--night-deep); background: rgba(255, 255, 255, 0.5); color: var(--night-deep); font: 900 1.0625rem/1 var(--display); cursor: pointer; transition: background 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease); }
.chips button:hover { background: #fff; }
.chips button:active { transform: scale(0.96); }
.chips button[aria-pressed="true"] { background: var(--night-deep); color: #fff; }

/* The nine counters: each one running by itself, nothing to tap */
.nine { padding: clamp(64px, 9vw, 120px) 0 clamp(56px, 8vw, 104px); }
.nine .wrap { max-width: 1440px; }
.nine h2, .routine h2, .contact h2 { font: 900 clamp(2rem, 4.2vw, 3.25rem)/1.05 var(--display); letter-spacing: -0.02em; text-align: center; text-wrap: balance; }
.rail { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: clamp(10px, 1.4vw, 18px); margin: clamp(28px, 4vw, 48px) 0 0; padding: 6px 0; list-style: none; }
.pick { display: grid; gap: 10px; font: 700 0.875rem/1.2 var(--body); text-align: center; }
.tile { position: relative; aspect-ratio: 1; border-radius: 26%; overflow: hidden; background: var(--bg); box-shadow: 0 14px 24px -16px rgba(22, 30, 66, 0.55); }
.tile img, .tile canvas { position: absolute; inset: 6%; width: 88%; height: 88%; object-fit: contain; }
.tile canvas { opacity: 0; transition: opacity 0.4s var(--ease); }
.is-live .tile canvas { opacity: 1; }

/* The routine: three pictures from the app, at night */
.routine { background: linear-gradient(var(--night-deep), var(--night-low)); color: #fff; padding: clamp(64px, 9vw, 120px) 0 0; position: relative; overflow: hidden; }
.routine::before { content: ""; position: absolute; inset: 0; pointer-events: none; background:
  radial-gradient(circle at 6% 9%, #fff 0 1.6px, transparent 2.2px), radial-gradient(circle at 17% 31%, var(--sky) 0 1.2px, transparent 1.8px),
  radial-gradient(circle at 29% 6%, #fff 0 1.1px, transparent 1.7px), radial-gradient(circle at 41% 17%, var(--sky) 0 1.5px, transparent 2.1px),
  radial-gradient(circle at 58% 5%, #fff 0 1.3px, transparent 1.9px), radial-gradient(circle at 71% 13%, #fff 0 1.7px, transparent 2.3px),
  radial-gradient(circle at 86% 7%, var(--sky) 0 1.2px, transparent 1.8px), radial-gradient(circle at 94% 27%, #fff 0 1.4px, transparent 2px),
  radial-gradient(circle at 3% 52%, #fff 0 1.2px, transparent 1.8px), radial-gradient(circle at 97% 58%, var(--sky) 0 1.5px, transparent 2.1px),
  radial-gradient(circle at 12% 78%, var(--sky) 0 1.3px, transparent 1.9px), radial-gradient(circle at 90% 84%, #fff 0 1.2px, transparent 1.8px); }
.routine .wrap { position: relative; }
.shots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2.6vw, 36px); margin-top: clamp(32px, 4.5vw, 56px); }
.shots figure { display: grid; gap: 16px; align-content: start; }
.shot { border-radius: 36px; overflow: hidden; background: var(--bg); aspect-ratio: 600 / 760; }
.shot img { width: 100%; height: auto; }
.shots figcaption { font: 800 clamp(1.0625rem, 1.6vw, 1.3125rem)/1.25 var(--display); text-align: center; text-wrap: balance; }

/* Contact: the Sami on the yellow planet, where the journey ends */
.contact { --hill: clamp(160px, 22vw, 300px); --sami: clamp(120px, 15vw, 176px); position: relative; display: flow-root; margin-top: calc(0.42 * var(--hill) + 1.225 * var(--sami) + clamp(40px, 6vw, 88px)); background: var(--sun); color: var(--night-deep); text-align: center; padding: 0 0 clamp(36px, 5vw, 56px); }
.contact::before { content: ""; position: absolute; left: 50%; top: 0; width: max(150vw, 1500px); height: var(--hill); transform: translate(-50%, -42%); border-radius: 50%; background: var(--sun); }
.contact .sami { position: relative; width: var(--sami); height: auto; margin: calc(-0.42 * var(--hill) - 1.225 * var(--sami) + 0.12 * var(--sami)) auto 0; }
.contact .wrap { position: relative; padding-top: clamp(20px, 3vw, 36px); }
.contact p.say { font: 700 clamp(1.0625rem, 1.6vw, 1.25rem)/1.4 var(--display); margin-top: 12px; }
.mail { display: inline-flex; align-items: center; min-height: 60px; padding: 0 34px; margin-top: 28px; border-radius: 999px; background: var(--night-deep); color: #fff; font: 900 1.1875rem/1 var(--display); text-decoration: none; box-shadow: 0 16px 26px -16px rgba(22, 30, 66, 0.8); transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease); }
.mail:hover { transform: translateY(-2px); box-shadow: 0 22px 30px -18px rgba(22, 30, 66, 0.85); }
.mail:active { transform: scale(0.98); }
.contact .faq { display: block; width: fit-content; margin: 18px auto 0; padding: 8px; font: 800 1rem/1.2 var(--display); }

.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 28px; margin-top: clamp(56px, 8vw, 96px); padding-top: 22px; border-top: 2px solid rgba(22, 30, 66, 0.16); font: 600 0.9375rem/1.3 var(--body); text-align: left; }
.foot ul { display: flex; flex-wrap: wrap; gap: 0 22px; margin: 0; padding: 0; list-style: none; }
.foot a { display: inline-block; padding: 10px 0; }

/* Text pages: privacy, terms, support */
.doc-top { background: var(--sky); }
.doc { max-width: 44rem; margin: 0 auto; padding: clamp(36px, 6vw, 72px) var(--gutter) clamp(56px, 8vw, 96px); }
.doc h1 { font: 900 clamp(2.25rem, 5vw, 3.5rem)/1.02 var(--display); letter-spacing: -0.02em; color: var(--night-deep); }
.doc .date { margin-top: 10px; font-size: 0.9375rem; color: rgba(30, 42, 90, 0.78); }
.doc .lead { font: 800 clamp(1.25rem, 2.4vw, 1.625rem)/1.3 var(--display); margin-top: 28px; text-wrap: balance; }
.doc h2 { font: 900 1.375rem/1.2 var(--display); margin-top: 44px; color: var(--night-deep); }
.doc p, .doc ul, .doc ol { margin-top: 12px; max-width: 68ch; }
.doc ul, .doc ol { padding-left: 1.3em; }
.doc li { margin-top: 6px; }
.doc li::marker { color: var(--night); font-weight: 700; }
.doc-foot { background: var(--night-deep); color: #fff; }
.doc-foot .foot { margin-top: 0; padding-top: 22px; padding-bottom: 22px; border: 0; }

@media (max-width: 880px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; gap: 40px; }
  .hero h1, .hero .sub { margin-left: auto; margin-right: auto; }
  .hero h1 { max-width: 12ch; }
  .stores { justify-content: center; }
  .stores { gap: 10px; }
  .stores img { height: 46px; }
  .device { width: min(72vw, 288px); }
  /* The nine become a row to drag sideways, with the next one showing by half */
  .rail { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter)); padding: 10px var(--gutter) 14px; scroll-padding-left: var(--gutter); }
  .rail::-webkit-scrollbar { display: none; }
  .rail li { flex: none; width: min(38vw, 168px); scroll-snap-align: start; }
  .pick { font-size: 0.9375rem; }
  .shots { grid-template-columns: minmax(0, 1fr); max-width: 380px; margin-left: auto; margin-right: auto; gap: 36px; }
  .foot { justify-content: center; text-align: center; }
  .foot ul { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 0.01ms !important; }
  .try { display: none; }
}
