
:root {
  --bg: #f5f5f3;
  --text: #111111;
  --muted: #707070;
  --red: #d71920;
  --red-dark: #a90f15;
  --white: #ffffff;
  --border: #dddddd;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  width: 100%;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
}

body {
  min-height: 100svh;
  overflow-x: hidden;
}

button,
a {
  font: inherit;
}

/* =========================================================
    APP
    ========================================================= */

#app {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;

  padding:
    max(22px, env(safe-area-inset-top))
    24px
    18px;

  pointer-events: none;
}

.brand {
  display: inline-block;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

/* =========================================================
    HOME
    ========================================================= */

.screen {
  min-height: 100svh;
  width: 100%;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding:
    90px
    24px
    70px;
  text-align: center;
}

.screen.active {
  display: flex;
}

.panic-container {
  width: min(78vw, 430px);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.panic-button {
  width: 100%;
  height: 100%;

  border: 0;
  border-radius: 50%;

  background: var(--red);
  color: var(--white);

  cursor: pointer;

  box-shadow:
    0 22px 55px rgba(0, 0, 0, 0.16),
    inset 0 -12px 0 rgba(0, 0, 0, 0.10);

  transition:
    transform 120ms ease,
    background 150ms ease,
    box-shadow 150ms ease;

  touch-action: manipulation;
  user-select: none;
}

.panic-button:hover {
  background: #c9141b;
}

.panic-button:active {
  transform: scale(0.965);
  background: var(--red-dark);

  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.12),
    inset 0 -6px 0 rgba(0, 0, 0, 0.10);
}

.panic-button:focus-visible {
  outline: 5px solid rgba(215, 25, 32, 0.25);
  outline-offset: 8px;
}

.panic-small {
  display: block;
  margin-bottom: 10px;

  font-size: clamp(12px, 2.5vw, 16px);
  font-weight: 650;

  opacity: 0.92;
}

.panic-big {
  display: block;

  font-size: clamp(25px, 6vw, 42px);
  line-height: 1.03;

  font-weight: 850;
  letter-spacing: -0.055em;
}

.why-link {
  margin-top: 30px;

  color: var(--muted);
  text-decoration: none;

  font-size: 15px;
  line-height: 1.4;

  border-bottom: 1px solid #aaa;
  padding-bottom: 2px;

  transition:
    color 150ms ease,
    border-color 150ms ease;
}

.why-link:hover {
  color: var(--text);
  border-color: var(--text);
}

.footer {
  position: fixed;
  bottom: max(16px, env(safe-area-inset-bottom));

  width: 100%;

  text-align: center;

  font-size: 12px;
  color: #999;

  pointer-events: none;
}

/* =========================================================
    CALM FLOW
    ========================================================= */

.flow {
  width: min(100%, 600px);
}

.step {
  display: none;
  width: 100%;

  animation: stepIn 260ms ease both;
}

.step.active {
  display: block;
}

@keyframes stepIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.step h1 {
  margin: 0 0 20px;

  font-size: clamp(34px, 9vw, 64px);
  line-height: 0.98;

  letter-spacing: -0.055em;
  font-weight: 850;
}

.step p {
  max-width: 480px;

  margin:
    0 auto
    28px;

  color: var(--muted);

  font-size: 18px;
  line-height: 1.5;
}

.primary {
  border: 0;
  border-radius: 999px;

  padding: 15px 28px;

  background: var(--text);
  color: var(--white);

  font-weight: 750;
  font-size: 16px;

  cursor: pointer;

  transition:
    transform 120ms ease,
    opacity 120ms ease;
}

.primary:hover {
  opacity: 0.9;
}

.primary:active {
  transform: scale(0.97);
}

.primary:disabled {
  opacity: 0.45;
  cursor: default;
}

/* =========================================================
    BREATHING
    ========================================================= */

.breathing {
  width: 190px;
  height: 190px;

  margin:
    35px auto
    40px;

  border-radius: 50%;

  background: var(--text);
  color: var(--white);

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 72px;
  font-weight: 800;

  letter-spacing: -0.07em;

  transition:
    transform 1s ease,
    opacity 1s ease;
}

.breathing.inhale {
  transform: scale(1.12);
}

.breathing.exhale {
  transform: scale(0.88);
}

/* =========================================================
    CHOICES
    ========================================================= */

.choices {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;

  max-width: 500px;
  margin: 0 auto;
}

.choice {
  border: 1px solid var(--border);
  border-radius: 999px;

  background: var(--white);
  color: var(--text);

  padding: 12px 18px;

  cursor: pointer;

  transition:
    background 120ms ease,
    color 120ms ease,
    border-color 120ms ease;
}

.choice:hover {
  border-color: var(--text);
}

/* =========================================================
    FINAL
    ========================================================= */

.save-box {
  margin: 35px auto 0;

  max-width: 480px;

  padding: 24px;

  border:
    1px solid var(--border);

  border-radius: 20px;

  background: rgba(255, 255, 255, 0.7);
}

.save-box h2 {
  margin:
    0 0 8px;

  font-size: 20px;
  letter-spacing: -0.03em;
}

.save-box p {
  margin-bottom: 20px;
  font-size: 15px;
}

.secondary {
  margin-top: 18px;

  border: 0;
  background: transparent;

  color: #777;

  font-size: 14px;

  cursor: pointer;
}

.secondary:hover {
  color: var(--text);
}

/* =========================================================
    MARKETING
    ========================================================= */

#marketing {
  align-items: stretch;
  text-align: left;

  overflow-y: auto;
}

.marketing-inner {
  width: min(100%, 760px);
  margin: auto;
}

.marketing-inner h1 {
  margin: 0 0 20px;

  font-size: clamp(42px, 9vw, 76px);
  line-height: 0.95;

  letter-spacing: -0.065em;
}

.marketing-inner h2 {
  margin:
    48px 0 12px;

  font-size: 26px;
  letter-spacing: -0.04em;
}

.marketing-inner p {
  max-width: 650px;

  color: var(--muted);

  font-size: 18px;
  line-height: 1.6;
}

.back-home {
  margin-top: 40px;

  border: 0;
  border-radius: 999px;

  background: var(--text);
  color: var(--white);

  padding: 14px 24px;

  cursor: pointer;
  font-weight: 700;
}

/* =========================================================
    MOBILE
    ========================================================= */

@media (max-width: 520px) {

  .screen {
    padding-left: 18px;
    padding-right: 18px;
  }

  .panic-container {
    width: min(82vw, 390px);
  }

  .step p {
    font-size: 17px;
  }

  .breathing {
    width: 160px;
    height: 160px;
    font-size: 60px;
  }

}

/* =========================================================
    ACCESSIBILITY
    ========================================================= */

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

}
