/* At Peace website. The extension's own colors: a cool grey ground, white panels, indigo ink, cobalt for
   actions, a mint dot; the deep indigo of the pause screen for the one dark band.
   Headlines in Literata (self-hosted, OFL), everything else in the system font, as in the extension. */

@font-face {
  font-family: "Literata";
  src: url("/fonts/literata-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ground: #EEF1F6;
  --panel: #FFFFFF;
  --panel-line: #DCE1EA;
  --row-line: #E8EBF2;
  --field-line: #8088A0;
  --ink: #10123F;
  --ink-2: #5B6078;          /* 5.5:1 on the ground */
  --act: #0D3CCC;
  --act-press: #0A2FA3;
  --act-soft: #DDE5FA;
  --mint: #0CE3A1;
  --mint-text: #067A57;
  --indigo: #16186F;
  --indigo-raised: #22257F;
  --indigo-line: #4A4EA8;
  --ix-text: #F2F3FF;
  --ix-text-2: #C9CBF2;
  --ix-quiet: #8C90D9;
  --ix-mint: #3FF1C0;
  --ix-on-mint: #0B0C3A;

  --serif: "Literata", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", "Noto Sans", sans-serif;

  --gutter: 16px;
  --measure: 1100px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --frame-shadow: 0 1px 2px rgb(16 18 63 / 0.06), 0 12px 40px -12px rgb(16 18 63 / 0.18);
}

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

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 1.1875rem/1.55 var(--sans);   /* 19px */
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a { color: var(--act); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

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

h1, h2 {
  font-family: var(--serif);
  font-weight: 500;
  margin: 0;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.5rem, 1.4rem + 4.6vw, 5rem);   /* 40 → 80px */
  line-height: 1.04;
  letter-spacing: -0.025em;
  max-width: 13em;
}

h2 {
  font-size: clamp(1.875rem, 1.4rem + 1.8vw, 2.75rem);   /* 30 → 44px */
  line-height: 1.1;
  letter-spacing: -0.018em;
}

p { margin: 0; }

.wrap {
  width: 100%;
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

@media (min-width: 720px) {
  :root { --gutter: 32px; }
}

/* ------------------------------------------------------------------ header */

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 20px;
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font: 500 1.3125rem/1 var(--serif);
  letter-spacing: -0.01em;
}

.bar-links a {
  color: var(--ink-2);
  text-decoration: none;
  font-size: 1.0625rem;
  padding: 8px 4px;
}
.bar-links a:hover { color: var(--ink); text-decoration: underline; }

/* ------------------------------------------------------------------ hero */

.hero {
  padding-top: clamp(40px, 8vw, 104px);
  padding-bottom: clamp(36px, 5vw, 56px);
}

.lede {
  margin-top: 20px;
  max-width: 32em;
  font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);   /* 20 → 24px */
  line-height: 1.45;
  color: var(--ink-2);
}

.get {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 28px;
  border-radius: 14px;
  background: var(--act);
  color: #fff;
  font: 600 1.125rem/1 var(--sans);
  text-decoration: none;
  transition: transform 100ms ease-out, background-color 160ms var(--ease);
}
.btn:hover { background: var(--act-press); text-decoration: none; }
.btn:active { transform: scale(0.97); }

/* With two buttons (a browser we can't tell, or no script), the second is the quieter one. */
.get .btn + .btn {
  background: var(--panel);
  color: var(--act);
  box-shadow: inset 0 0 0 1.5px var(--act);
}
.get .btn + .btn:hover { background: var(--act-soft); }

.fine {
  margin-top: 14px;
  font-size: 1rem;
  color: var(--ink-2);
}

/* ------------------------------------------------------------------ the switch and the screenshot */

.flip {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: 20px;
  box-shadow: var(--frame-shadow);
  overflow: hidden;
}
.wrap.flip { padding-inline: 0; max-width: var(--measure); width: calc(100% - 2 * var(--gutter)); }

/* The real control: a checkbox, visually replaced by the switch. */
.flip-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  margin: 0;
}

.flip-bar {
  border-bottom: 1px solid var(--row-line);
  background: var(--ground);
}

.switch {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.switch-name {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  font: 700 1.1875rem/1 var(--sans);
}

/* The extension's signal: a ring with a mint dot that goes grey when it is off. */
.dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  display: grid;
  place-items: center;
}
.dot::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mint);
  transition: background-color 200ms var(--ease);
}

.switch-state { font-size: 1.0625rem; color: var(--mint-text); min-width: 2em; text-align: right; }
.switch-state .off { display: none; color: var(--ink-2); }

.switch-track {
  position: relative;
  width: 56px;
  height: 32px;
  border-radius: 16px;
  background: var(--act);
  transition: background-color 200ms var(--ease);
}
.switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 1px 2px rgb(16 18 63 / 0.25);
  transform: translateX(24px);
  transition: transform 300ms cubic-bezier(0.3, 1.3, 0.5, 1), width 120ms ease-out;
}
/* Pressing stretches the knob, like the extension's switch. */
.switch:active .switch-knob { width: 32px; }
.flip-input:checked ~ .flip-bar .switch:active .switch-knob { transform: translateX(18px); }

.flip-input:focus-visible ~ .flip-bar .switch-track { outline: 3px solid var(--act); outline-offset: 3px; }

.flip-input:not(:checked) ~ .flip-bar .switch-track { background: var(--field-line); }
.flip-input:not(:checked) ~ .flip-bar .switch-knob { transform: translateX(0); }
.flip-input:not(:checked) ~ .flip-bar .dot::after { background: var(--field-line); }
.flip-input:not(:checked) ~ .flip-bar .on { display: none; }
.flip-input:not(:checked) ~ .flip-bar .off { display: inline; }

.shot {
  margin: 0;
  display: grid;
}
.shot img { grid-area: 1 / 1; width: 100%; }

/* "Before" stays unloaded (display: none) until someone turns the switch off. */
.shot-after {
  position: relative;
  z-index: 1;
  transition: opacity 450ms var(--ease);
}
.shot-before {
  display: none;
  transition: display 450ms allow-discrete;
}
.flip-input:not(:checked) ~ .shot .shot-after { opacity: 0; }
.flip-input:not(:checked) ~ .shot .shot-before { display: block; }

/* ------------------------------------------------------------------ the tour video */

.tour {
  display: grid;
  gap: 20px 48px;
  padding-block: clamp(72px, 10vw, 128px) 0;
}
.tour-text p { margin-top: 12px; color: var(--ink-2); max-width: 22em; }

.video {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  overflow: hidden;
  background: var(--indigo);
  box-shadow: var(--frame-shadow);
  color: #fff;
  text-decoration: none;
}
.video img, .video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;   /* trims the letterbox bars of YouTube's 4:3 thumbnail */
}
.video::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgb(16 18 63 / 0) 55%, rgb(16 18 63 / 0.55));
  pointer-events: none;
}
.play {
  position: absolute;
  left: 20px;
  bottom: 20px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px 10px 10px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.94);
  color: var(--ink);
  font: 600 1.0625rem/1 var(--sans);
  transition: transform 100ms ease-out;
}
.play-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--act);
  display: grid;
  place-items: center;
}
.play-icon::after {
  content: "";
  width: 14px;
  height: 16px;
  margin-left: 3px;
  background: #fff;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.video:hover .play { background: #fff; }
.video:active .play { transform: scale(0.97); }
.video.is-playing::after, .video.is-playing .play { display: none; }

@media (min-width: 900px) {
  .tour { grid-template-columns: 1fr 2fr; align-items: center; }
}

/* ------------------------------------------------------------------ features */

.feature {
  display: grid;
  gap: 28px 64px;
  padding-top: clamp(80px, 12vw, 152px);
}
.feature-text p { margin-top: 14px; color: var(--ink-2); max-width: 26em; }

@media (min-width: 900px) {
  .feature.split { grid-template-columns: 5fr 6fr; align-items: center; }
}

.popup {
  width: 100%;
  max-width: 381px;
  justify-self: center;
  border-radius: 16px;
  box-shadow: var(--frame-shadow);
}

/* Panels drawn like the extension's popup. */
.panel {
  justify-self: center;
  width: 100%;
  max-width: 460px;
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: 18px;
  box-shadow: var(--frame-shadow);
  padding: 22px;
}
.panel-title { font-weight: 700; font-size: 1.1875rem; }

.tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 16px 0 10px;
}
.tile {
  display: grid;
  place-items: center;
  min-height: 64px;
  padding: 6px;
  border-radius: 12px;
  background: var(--ground);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  text-align: center;
}
.tile:first-child { background: var(--act-soft); color: var(--act); box-shadow: inset 0 0 0 1.5px var(--act); }

.row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--row-line);
  font-size: 1.0625rem;
}
.row:last-child { padding-bottom: 0; }
.row-value { color: var(--ink-2); text-align: right; }

.lock-line { margin-top: 14px; color: var(--ink-2); font-size: 1.0625rem; }
.lock-sentence { margin-top: 6px; font: 500 1.375rem/1.35 var(--serif); }
.field {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1.5px solid var(--field-line);
  border-radius: 10px;
  color: var(--ink-2);
  font-size: 1.0625rem;
}

@media (max-width: 420px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
}

/* ------------------------------------------------------------------ the pause (indigo band) */

.pause {
  margin-top: clamp(80px, 12vw, 152px);
  background: var(--indigo);
  color: var(--ix-text);
  padding-block: clamp(64px, 9vw, 112px);
}
.pause-inner { display: grid; gap: 40px 64px; }
.pause-text p { margin-top: 14px; color: var(--ix-text-2); max-width: 26em; }

@media (min-width: 900px) {
  .pause-inner { grid-template-columns: 5fr 6fr; align-items: center; }
}

.pause-screen {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 28px 36px;
  background: var(--indigo-raised);
  border-radius: 22px;
  padding: clamp(24px, 4vw, 40px);
}

/* Sixty ticks round a mint breath. */
.dial {
  position: relative;
  flex: none;
  width: 168px;
  aspect-ratio: 1;
  border-radius: 50%;
}
.dial::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: repeating-conic-gradient(var(--ix-mint) 0 1.2deg, transparent 1.2deg 6deg);
  -webkit-mask: radial-gradient(circle, transparent 0 63%, #000 64% 71%, transparent 72%);
  mask: radial-gradient(circle, transparent 0 63%, #000 64% 71%, transparent 72%);
}
.sun {
  position: absolute;
  inset: 22%;
  border-radius: 50%;
  background: var(--ix-mint);
  transform: scale(0.82);
  animation: breathe 8s cubic-bezier(0.45, 0, 0.55, 1) 1s 3;
}
@keyframes breathe {
  0%, 100% { transform: scale(0.82); }
  45%, 55% { transform: scale(1.18); }
}

.pause-copy { flex: 1 1 240px; }
.kicker { color: var(--ix-text-2); font-size: 1rem; }
.question { margin-top: 4px; font: 500 clamp(1.75rem, 1.4rem + 1.2vw, 2.25rem)/1.1 var(--serif); letter-spacing: -0.015em; }
.pause-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.pbtn {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1.5px var(--indigo-line);
  font-weight: 600;
  font-size: 1.0625rem;
}
.pbtn-primary { background: var(--ix-mint); color: var(--ix-on-mint); box-shadow: none; }
.seg {
  display: inline-flex;
  margin-top: 12px;
  padding: 4px;
  border-radius: 12px;
  background: rgb(8 9 50 / 0.5);
  font-size: 1rem;
}
.seg span { padding: 8px 14px; border-radius: 9px; color: var(--ix-text-2); }
.seg .seg-on { background: var(--indigo-line); color: var(--ix-text); }

/* ------------------------------------------------------------------ install + footer */

.install {
  padding-block: clamp(96px, 14vw, 176px) clamp(72px, 10vw, 120px);
}
.install .fine { max-width: 34em; }

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 32px;
  padding-block: 28px 40px;
  border-top: 1px solid var(--panel-line);
  font-size: 1rem;
}
.maker {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}
.maker img { width: 48px; height: 48px; border-radius: 50%; }
.maker:hover span, .maker:hover { text-decoration: underline; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.foot-links a { color: var(--ink-2); }
.foot-links a:hover { color: var(--ink); }

/* ------------------------------------------------------------------ text pages (privacy, 404) */

.doc {
  max-width: calc(46rem + 2 * var(--gutter));
  padding-block: clamp(32px, 6vw, 72px) clamp(72px, 10vw, 120px);
}
.doc h1 { font-size: clamp(2.5rem, 1.8rem + 3vw, 3.75rem); }
.doc h2 { font-size: clamp(1.5rem, 1.3rem + 0.8vw, 1.875rem); margin-top: 56px; }
.doc p, .doc ul { margin-top: 16px; }
.doc .lede { margin-top: 20px; }
.doc ul { padding-left: 1.2em; }
.doc li + li { margin-top: 8px; }
.doc code {
  font: 0.9em/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  background: var(--panel);
  border: 1px solid var(--row-line);
  border-radius: 6px;
  padding: 0.1em 0.35em;
  overflow-wrap: anywhere;
}

.table {
  margin-top: 20px;
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: 16px;
  overflow: hidden;
  font-size: 1.0625rem;
  line-height: 1.5;
}
.table th, .table td { text-align: left; vertical-align: top; padding: 14px 16px; border-top: 1px solid var(--row-line); }
.table thead th { border-top: 0; background: var(--ground); color: var(--ink-2); font-weight: 600; }

@media (max-width: 719px) {
  .table, .table tbody, .table tr, .table td, .table th { display: block; }
  .table thead { display: none; }
  .table tr { padding: 6px 0; border-top: 1px solid var(--row-line); }
  .table tr:first-child { border-top: 0; }
  .table th, .table td { border-top: 0; padding: 6px 16px; }
  .table td::before { content: attr(data-label); display: block; color: var(--ink-2); font-size: 1rem; font-weight: 600; }
}

.lost .btn { margin-top: 32px; }

/* ------------------------------------------------------------------ motion and contrast preferences */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation: none !important; }
  .btn:active, .video:active .play { transform: none; }
}

@media (prefers-contrast: more) {
  :root { --ink-2: #3A3F58; --panel-line: #8088A0; --row-line: #B4BACB; }
}
