/* Zen: Pomodoro Tracker, gethorizon.app/zen */

:root {
  color-scheme: light dark;

  --bg: #fff;
  --bg-raised: #f5f5f7;
  --panel-base: #fff;
  --ink: #1d1d1f;
  --ink-2: #6e6e73;
  --rule: rgb(0 0 0 / 0.1);
  --link: #b54a22;

  /* Session colours from the app's asset catalogue, as sRGB fallbacks;
     the Display P3 originals follow. */
  --focus-light: #ffab74;
  --focus: #ff926a;
  --focus-dark: #ff775b;
  --rest-light: #7cdbf8;
  --rest: #3ccef5;
  --rest-dark: #38c2e7;
  --recharge-light: #bbf94a;
  --recharge: #a1e04a;
  --recharge-dark: #8ad349;

  /* Darker shades for text on light backgrounds (WCAG AA). */
  --focus-ink: #b54a22;
  --rest-ink: #13789e;
  --recharge-ink: #437a0f;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-rounded: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, system-ui,
    "Segoe UI", Roboto, sans-serif;
  --page: 1080px;
  --gutter: 24px;
}

@supports (color: color(display-p3 1 1 1)) {
  :root {
    --focus-light: color(display-p3 0.965 0.686 0.49);
    --focus: color(display-p3 0.969 0.596 0.451);
    --focus-dark: color(display-p3 0.996 0.502 0.392);
    --rest-light: color(display-p3 0.576 0.851 0.961);
    --rest: color(display-p3 0.42 0.796 0.945);
    --rest-dark: color(display-p3 0.392 0.749 0.89);
    --recharge-light: color(display-p3 0.784 0.969 0.408);
    --recharge: color(display-p3 0.682 0.871 0.384);
    --recharge-dark: color(display-p3 0.604 0.82 0.369);
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000;
    --bg-raised: #1c1c1e;
    --panel-base: #161617;
    --ink: #f5f5f7;
    --ink-2: #a1a1a6;
    --rule: rgb(255 255 255 / 0.14);
    --link: #f79873;
    --focus-ink: var(--focus);
    --rest-ink: var(--rest);
    --recharge-ink: var(--recharge);
  }
}

/* Base */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 3px;
  border-radius: 4px;
}

h1,
h2,
h3 {
  font-family: var(--font-rounded);
  font-weight: 700;
  margin: 0;
  text-wrap: balance;
}

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

.wrap {
  max-width: calc(var(--page) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Header and footer */

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font: 700 22px/1 var(--font-rounded);
}

.brand:hover {
  text-decoration: none;
}

.brand img {
  width: 32px;
  height: 32px;
}

.site-header nav {
  display: flex;
  gap: 24px;
}

.site-header nav a,
.site-footer nav a {
  color: var(--ink-2);
  font-size: 15px;
}

.site-header nav a:hover,
.site-footer nav a:hover,
.site-header nav a[aria-current="page"] {
  color: var(--ink);
}

.site-footer {
  border-top: 1px solid var(--rule);
  color: var(--ink-2);
  font-size: 15px;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding-top: 28px;
  padding-bottom: 40px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

/* App icon: the iOS rounded square, with an edge for the near-white icon. */

.app-icon img,
.brand img {
  border-radius: 22.5%;
  box-shadow: 0 0 0 0.5px rgb(0 0 0 / 0.08);
}

.app-icon img {
  width: 112px;
  height: 112px;
  box-shadow:
    0 0 0 0.5px rgb(0 0 0 / 0.06),
    0 14px 32px -12px rgb(160 70 30 / 0.35);
}

/* App Store badge: Apple's artwork, shown as supplied (black, or white in
   dark mode), since the App Store marketing guidelines allow no changes. */

.app-store {
  display: inline-block;
}

.app-store:focus-visible {
  border-radius: 10px;
}

.app-store img {
  display: block;
  width: auto;
  height: 54px;
}

/* Phone frame around captures and the preview loop. The island covers the
   one the simulator draws into the recording. */

.phone {
  --w: 260px;
  position: relative;
  width: var(--w);
  padding: calc(var(--w) * 0.034);
  border-radius: calc(var(--w) * 0.152);
  background: #1b1b1d;
  box-shadow:
    inset 0 0 0 calc(var(--w) * 0.007) #3a3a3d,
    0 40px 60px -30px rgb(60 30 15 / 0.45),
    0 16px 30px -18px rgb(0 0 0 / 0.3);
}

.phone picture {
  display: block;
}

.phone img,
.phone video {
  width: 100%;
  aspect-ratio: 660 / 1434;
  border-radius: calc(var(--w) * 0.118);
  background: #fff;
  object-fit: cover;
}

/* The loop's first frame until the video plays: a background rather than a
   poster attribute, so it follows the colour scheme as the sources do. */
.phone-hero video {
  background: #fff url("loop-poster.jpg") center / cover;
}

@media (prefers-color-scheme: dark) {
  .phone img,
  .phone video {
    background-color: #000;
  }

  .phone-hero video {
    background-image: url("loop-dark-poster.jpg");
  }
}

.phone::after {
  content: "";
  position: absolute;
  top: calc(var(--w) * 0.062);
  left: 50%;
  width: calc(var(--w) * 0.27);
  height: calc(var(--w) * 0.082);
  border-radius: 999px;
  background: #000;
  transform: translateX(-50%);
}

/* Hero */

.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(38% 46% at 76% 34%, color-mix(in srgb, var(--focus) 34%, transparent), transparent),
    radial-gradient(30% 40% at 96% 88%, color-mix(in srgb, var(--rest) 26%, transparent), transparent),
    radial-gradient(28% 34% at 52% 104%, color-mix(in srgb, var(--recharge) 22%, transparent), transparent);
  -webkit-mask-image: linear-gradient(#000 60%, transparent);
  mask-image: linear-gradient(#000 60%, transparent);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  align-items: center;
  gap: 48px;
  padding-top: 48px;
  padding-bottom: 88px;
}

.hero-copy .app-icon {
  display: block;
  margin-bottom: 28px;
}

.eyebrow {
  margin-bottom: 12px;
  color: var(--ink-2);
  font: 600 17px/1.3 var(--font-rounded);
}

.hero h1 {
  font-size: clamp(46px, 6.6vw, 76px);
  line-height: 1.04;
  letter-spacing: -0.025em;
}

.lead {
  max-width: 30em;
  margin-top: 24px;
  color: var(--ink-2);
  font-size: 21px;
  line-height: 1.45;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 20px;
  margin-top: 36px;
}

.requirements {
  color: var(--ink-2);
  font-size: 15px;
}

.hero-visual {
  display: flex;
  justify-content: center;
}

.phone-hero {
  --w: 300px;
}

/* Marker under the session words in the headline. */

.mark {
  position: relative;
  z-index: 0;
  white-space: nowrap;
}

.mark::after {
  content: "";
  position: absolute;
  right: -0.06em;
  bottom: 0.06em;
  left: -0.06em;
  z-index: -1;
  height: 0.3em;
  border-radius: 0.15em;
  background: var(--marker);
  opacity: 0.6;
}

.mark-focus { --marker: var(--focus); }
.mark-rest { --marker: var(--rest); }
.mark-recharge { --marker: var(--recharge); }

/* Sections */

.section {
  padding: 88px 0;
}

.section-title {
  font-size: clamp(34px, 4.6vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-align: center;
}

.section-lead {
  max-width: 34em;
  margin: 16px auto 0;
  color: var(--ink-2);
  font-size: 19px;
  text-align: center;
}

/* The three sessions, each a countdown pie in the icon's squircle. */

@property --angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 270deg;
}

.sessions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin: 56px 0 0;
  padding: 0;
  list-style: none;
}

.session {
  padding: 36px 28px 32px;
  border-radius: 32px;
  background: var(--bg-raised);
  text-align: center;
}

.session h3 {
  font-size: 26px;
}

.session .duration {
  margin-top: 2px;
  color: var(--session-ink);
  font: 600 16px/1.4 var(--font-rounded);
}

.session p:last-child {
  margin-top: 12px;
  color: var(--ink-2);
}

.pie {
  width: 128px;
  aspect-ratio: 1;
  margin: 0 auto 24px;
  background: conic-gradient(var(--from), var(--to) var(--angle),
    color-mix(in srgb, var(--from) 22%, var(--bg-raised)) var(--angle));
  -webkit-mask: url("squircle.svg") center / 100% 100% no-repeat;
  mask: url("squircle.svg") center / 100% 100% no-repeat;
  animation: countdown var(--length) infinite;
}

/* One second for every 2 minutes of the default length, then a quick refill. */
@keyframes countdown {
  0% {
    --angle: 360deg;
    animation-timing-function: linear;
  }
  94% {
    --angle: 0deg;
    animation-timing-function: cubic-bezier(0.3, 0, 0.2, 1);
  }
  100% {
    --angle: 360deg;
  }
}

.session-focus {
  --from: var(--focus-light);
  --to: var(--focus-dark);
  --session-ink: var(--focus-ink);
}

.session-focus .pie {
  --length: 50s;
  animation-delay: -14s;
}

.session-rest {
  --from: var(--rest-light);
  --to: var(--rest-dark);
  --session-ink: var(--rest-ink);
}

.session-rest .pie {
  --length: 10s;
  animation-delay: -4s;
}

.session-recharge {
  --from: var(--recharge-light);
  --to: var(--recharge-dark);
  --session-ink: var(--recharge-ink);
}

.session-recharge .pie {
  --length: 30s;
  animation-delay: -11s;
}

/* Features: copy beside a capture on a panel in the session's colour, like
   the App Store screenshots. */

.feature {
  padding: 40px 0;
}

.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 72px;
}

.feature-flip .feature-visual {
  order: -1;
}

.feature .eyebrow {
  color: var(--session-ink);
}

.feature h2 {
  font-size: clamp(30px, 3.8vw, 42px);
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.feature-copy p:not(.eyebrow),
.feature-copy ul {
  margin-top: 16px;
  color: var(--ink-2);
  font-size: 19px;
}

.feature-copy ul {
  padding-left: 1.2em;
}

.feature-copy li + li {
  margin-top: 6px;
}

.feature-copy li::marker {
  color: var(--session-ink);
}

.feature-visual {
  display: flex;
  justify-content: center;
  padding: 56px 24px;
  border-radius: 36px;
  background: linear-gradient(170deg,
    color-mix(in srgb, var(--from) 26%, var(--panel-base)),
    color-mix(in srgb, var(--to) 16%, var(--panel-base)));
}

.feature-focus {
  --from: var(--focus-light);
  --to: var(--focus);
  --session-ink: var(--focus-ink);
}

.feature-rest {
  --from: var(--rest-light);
  --to: var(--rest);
  --session-ink: var(--rest-ink);
}

.feature-recharge {
  --from: var(--recharge-light);
  --to: var(--recharge);
  --session-ink: var(--recharge-ink);
}

@media (prefers-color-scheme: dark) {
  .mark::after {
    opacity: 0.9;
  }

  /* Tints over black turn muddy; light the panel from below instead. */
  .feature-visual {
    background:
      radial-gradient(90% 55% at 50% 100%, color-mix(in srgb, var(--to) 30%, transparent), transparent),
      var(--panel-base);
  }
}

.feature-night {
  --session-ink: var(--ink-2);
}

.feature-night .feature-visual {
  background: linear-gradient(170deg, #2c2c2e, #0d0d0e);
}

.feature-night .phone {
  box-shadow:
    inset 0 0 0 calc(var(--w) * 0.007) #4a4a4d,
    0 40px 60px -30px rgb(0 0 0 / 0.7);
}

/* Privacy */

.privacy-card {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 32px;
  border-radius: 36px;
  background: var(--bg-raised);
  text-align: center;
}

.privacy-card svg {
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
}

.privacy-card h2 {
  font-size: clamp(30px, 3.8vw, 40px);
  letter-spacing: -0.02em;
}

.privacy-card p {
  max-width: 30em;
  margin: 14px auto 0;
  color: var(--ink-2);
  font-size: 19px;
}

.privacy-card p:last-child {
  margin-top: 20px;
  font-size: 17px;
}

/* Closing call to action */

.closing {
  text-align: center;
}

.closing .app-icon {
  display: inline-block;
}

.closing .app-icon img {
  width: 96px;
  height: 96px;
}

.closing h2 {
  margin-top: 24px;
  font-size: clamp(30px, 3.8vw, 40px);
  letter-spacing: -0.02em;
}

.closing .cta {
  justify-content: center;
  margin-top: 28px;
}

/* Text pages: privacy policy, support, not found */

.doc {
  max-width: 728px;
  margin: 0 auto;
  padding: 40px var(--gutter) 96px;
}

.doc h1 {
  font-size: clamp(36px, 5vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.doc .updated,
.doc .intro {
  margin-top: 10px;
  color: var(--ink-2);
}

.doc .intro {
  font-size: 19px;
}

.doc section {
  margin-top: 36px;
}

.doc h2 {
  font-size: 22px;
  line-height: 1.3;
}

.doc section p {
  margin-top: 8px;
  color: var(--ink-2);
}

.doc header {
  padding-bottom: 28px;
  border-bottom: 1px solid var(--rule);
}

.contact-card {
  margin-top: 48px;
  padding: 28px 28px 30px;
  border-radius: 28px;
  background: var(--bg-raised);
}

.contact-card h2 {
  font-size: 22px;
}

.contact-card p {
  margin-top: 6px;
  color: var(--ink-2);
}

.not-found {
  padding-top: 96px;
  text-align: center;
}

.not-found p {
  margin-top: 12px;
  color: var(--ink-2);
  font-size: 19px;
}

/* Narrow screens */

@media (max-width: 900px) {
  .hero-grid,
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .hero::before {
    background:
      radial-gradient(75% 26% at 50% 74%, color-mix(in srgb, var(--focus) 30%, transparent), transparent),
      radial-gradient(50% 20% at 92% 94%, color-mix(in srgb, var(--rest) 24%, transparent), transparent),
      radial-gradient(50% 20% at 8% 97%, color-mix(in srgb, var(--recharge) 20%, transparent), transparent);
    -webkit-mask-image: linear-gradient(#000 88%, transparent);
    mask-image: linear-gradient(#000 88%, transparent);
  }

  .hero-grid {
    gap: 56px;
    padding-top: 24px;
    padding-bottom: 64px;
    text-align: center;
  }

  .hero-copy .app-icon {
    display: inline-block;
  }

  .lead {
    margin-right: auto;
    margin-left: auto;
  }

  .cta {
    flex-direction: column;
    justify-content: center;
  }

  .phone-hero {
    --w: 270px;
  }

  .sessions {
    grid-template-columns: 1fr;
    max-width: 420px;
    margin-right: auto;
    margin-left: auto;
  }

  .feature-grid {
    gap: 32px;
  }

  .feature-flip .feature-visual {
    order: 0;
  }

  .section {
    padding: 64px 0;
  }
}

@media (max-width: 600px) {
  :root {
    --gutter: 16px;
  }

  .site-header nav {
    gap: 18px;
  }

  .lead {
    font-size: 19px;
  }

  .phone {
    --w: min(240px, 64vw);
  }

  .phone-hero {
    --w: min(260px, 68vw);
  }

  .sessions {
    gap: 12px;
    margin-top: 40px;
  }

  .session {
    display: grid;
    grid-template-columns: 84px 1fr;
    align-items: center;
    column-gap: 20px;
    padding: 20px;
    border-radius: 26px;
    text-align: left;
  }

  .session .pie {
    grid-row: 1 / span 3;
    width: 84px;
    margin: 0;
  }

  .session h3 {
    font-size: 22px;
  }

  .session p:last-child {
    margin-top: 4px;
    font-size: 16px;
  }

  .feature-visual {
    padding: 40px 16px;
    border-radius: 28px;
  }

  .feature-copy p:not(.eyebrow),
  .feature-copy ul,
  .privacy-card p {
    font-size: 17px;
  }

  .privacy-card {
    padding: 40px 20px;
    border-radius: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pie {
    animation: none;
  }

  .session-rest .pie {
    --angle: 140deg;
  }

  .session-recharge .pie {
    --angle: 210deg;
  }
}
