/* Screendial website: black and white, blue where it helps, set in Inter. */

:root {
  --white: #ffffff;
  --black: #000000;
  --text-dim: rgba(255, 255, 255, 0.72);
  --text-faint: rgba(255, 255, 255, 0.5);
  --line: rgba(255, 255, 255, 0.14);
  --blue: #3b82f6;
  --gutter: clamp(20px, 4vw, 56px);
  --glass: rgba(255, 255, 255, 0.08);
  --glass-line: rgba(255, 255, 255, 0.16);
  --glass-edge: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 12px 40px rgba(0, 0, 0, 0.28);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: dark;
}

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

/* Screendial's blue pointer everywhere, except where text is typed. */
*,
*::before,
*::after {
  cursor: -webkit-image-set(url("/assets/brand/cursor.png") 1x, url("/assets/brand/cursor@2x.png") 2x) 4 4, url("/assets/brand/cursor.png") 4 4, auto !important;
}

input,
textarea {
  cursor: text !important;
}

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

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--black);
  color: var(--white);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

::selection {
  background: var(--blue);
  color: var(--white);
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

/* the logo is a black "s." on transparent; on this black site it's drawn white */
.logo {
  display: block;
  width: 56px;
  height: 56px;
  margin: -6px;
  filter: invert(1);
}

/* --------------------------------------------------------------------------
   Home: full-screen video, text in the corners
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  isolation: isolate;
}

.hero-video,
.hero-fallback {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* shown until videos/background.mp4 is uploaded (and behind it while it loads) */
.hero-fallback {
  overflow: hidden;
  background: #04050a;
}

/* Two soft lights drifting slowly. Only transforms animate, to stay light on the GPU. */
.hero-fallback::before,
.hero-fallback::after {
  content: "";
  position: absolute;
  width: 75vmax;
  height: 75vmax;
  border-radius: 50%;
  will-change: transform;
}

.hero-fallback::before {
  top: -30vmax;
  right: -15vmax;
  background: radial-gradient(closest-side, rgba(59, 130, 246, 0.5), transparent);
  animation: drift-one 24s ease-in-out infinite alternate;
}

.hero-fallback::after {
  bottom: -40vmax;
  left: -20vmax;
  background: radial-gradient(closest-side, rgba(124, 92, 246, 0.36), transparent);
  animation: drift-two 30s ease-in-out infinite alternate;
}

@keyframes drift-one {
  to { transform: translate(-16vmax, 12vmax) scale(1.12); }
}

@keyframes drift-two {
  to { transform: translate(18vmax, -10vmax) scale(0.92); }
}

/* keeps white text readable over any video, with a little grain to stop the lights banding */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"),
    linear-gradient(180deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.1) 45%, rgba(0, 0, 0, 0.6) 100%);
  pointer-events: none;
}

.hero-top {
  padding: 28px var(--gutter) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.hero-auth {
  display: flex;
  gap: 10px;
}

.auth-button {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 18px;
  border: 1px solid var(--glass-line);
  border-radius: 12px;
  background: var(--glass);
  box-shadow: var(--glass-edge);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: transform 0.2s var(--ease), background 0.2s, box-shadow 0.2s;
}

.auth-button:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.auth-button--primary,
.auth-button--primary:hover {
  border-color: var(--white);
  background: var(--white);
  color: var(--black);
}

.auth-button--primary:hover {
  box-shadow: 0 6px 24px rgba(255, 255, 255, 0.22);
}

.hero-middle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 40px;
  padding: 48px var(--gutter);
}

.headline {
  max-width: 11ch;
  font-size: clamp(44px, 7vw, 96px);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.04em;
  background: linear-gradient(180deg, #ffffff 35%, rgba(255, 255, 255, 0.68) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lead {
  display: grid;
  gap: clamp(20px, 3vh, 32px);
  min-width: 0;
}

.hero-lead > * {
  animation: rise 0.8s var(--ease) both;
}

.hero-lead > .demo-bar {
  animation-delay: 0.12s;
}

.downloads {
  animation: rise 0.8s 0.2s var(--ease) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
}

/* a picture of the app's input bar */
.demo-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(100%, 460px);
  height: 52px;
  padding: 0 8px 0 16px;
  border: 1px solid var(--glass-line);
  border-radius: 26px;
  background: var(--glass);
  box-shadow: var(--glass-edge);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  user-select: none;
}

.demo-logo {
  font-size: 15px;
  font-weight: 600;
}

.demo-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--text-dim);
  font-size: 15px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.demo-icon {
  flex: none;
  width: 17px;
  height: 17px;
  color: var(--text-dim);
}

.demo-send {
  flex: none;
  padding: 8px 16px;
  border-radius: 18px;
  background: var(--blue);
  font-size: 13px;
  font-weight: 600;
}

/* the app's pointer; home.js places it */
.demo-cursor {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35));
}

.demo-cursor.ready {
  opacity: 1;
  animation: rise 0.6s 0.5s var(--ease) backwards;
}

.demo-cursor.moving {
  transition: transform 1.5s var(--ease);
}

.downloads {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--glass-line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: var(--glass-edge);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
}

/* The hidden attribute must win over display rules like .download's inline-flex. */
[hidden] {
  display: none !important;
}

.download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 248px;
  height: 52px;
  padding: 0 22px;
  border-radius: 12px;
  background: var(--white);
  color: var(--black);
  font-size: 17px;
  font-weight: 500;
  text-decoration: none;
  transition: opacity 0.15s;
}

.download:hover {
  opacity: 0.88;
}

.download--secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.hero .download {
  width: 100%;
  transition: transform 0.2s var(--ease), box-shadow 0.2s, background 0.2s;
}

.hero .download:hover {
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(255, 255, 255, 0.2);
}

.hero .download--secondary {
  border-color: var(--glass-line);
  background: var(--glass);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.hero .download--secondary:hover {
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.download svg {
  width: 20px;
  height: 20px;
  flex: none;
}

.downloads-note {
  margin: 6px 4px 2px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-dim);
}

.hero-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 var(--gutter);
  padding: 18px 0 24px;
}

.wordmark {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-dim);
}

.legal-links {
  display: flex;
  gap: clamp(20px, 4vw, 56px);
  padding-bottom: 8px;
  list-style: none;
}

.legal-links a {
  font-size: 13px;
  color: var(--text-dim);
  text-decoration: none;
}

.legal-links a:hover {
  color: var(--white);
}

@media (max-width: 820px) {
  .hero-middle {
    grid-template-columns: minmax(0, 1fr);
    align-content: center;
    gap: 36px;
  }

  .headline {
    max-width: 12ch;
  }

  .downloads {
    align-items: stretch;
    text-align: left;
  }

  .download {
    width: 100%;
    min-width: 0;
  }

  .hero-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  /* no room to travel when the columns stack */
  .demo-cursor {
    display: none;
  }

  .demo-bar {
    width: 100%;
  }

  .legal-links {
    flex-wrap: wrap;
    gap: 12px 24px;
    padding-bottom: 0;
  }
}

/* Short windows: keep everything on one screen. */
@media (max-height: 640px) and (min-width: 821px) {
  .headline {
    font-size: clamp(40px, 6vw, 64px);
  }

  .hero-middle {
    padding-block: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-fallback::before,
  .hero-fallback::after,
  .hero-lead > *,
  .downloads,
  .demo-cursor.ready {
    animation: none;
  }

  .demo-cursor.moving {
    transition: none;
  }
}

/* --------------------------------------------------------------------------
   Legal pages
   -------------------------------------------------------------------------- */

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px var(--gutter);
}

.page-header a {
  font-size: 14px;
  color: var(--text-dim);
  text-decoration: none;
}

.page-header a:hover {
  color: var(--white);
}

.legal {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px var(--gutter) 96px;
  line-height: 1.7;
}

.legal h1 {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.legal .updated {
  margin: 12px 0 40px;
  font-size: 14px;
  color: var(--text-faint);
}

.legal h2 {
  margin: 40px 0 12px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.legal p,
.legal li {
  font-size: 16px;
  color: var(--text-dim);
}

.legal p + p {
  margin-top: 14px;
}

.legal ul {
  margin: 12px 0 0 20px;
}

.legal li + li {
  margin-top: 8px;
}

.legal strong {
  color: var(--white);
  font-weight: 600;
}

.legal a {
  color: var(--blue);
}

.page-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  padding: 24px var(--gutter) 32px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--text-faint);
}

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

.page-footer a {
  color: var(--text-dim);
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   Account
   -------------------------------------------------------------------------- */

/* Scale: 13 small, 14 secondary, 15 body, 18 section, 28-32 title. Spacing steps: 8, 16, 24, 40.
   Controls are 44px tall (40px when small) and inputs stay 16px so iOS doesn't zoom on focus. */

body:has(.account) {
  display: flex;
  flex-direction: column;
}

.legal.account {
  flex: 1;
  width: 100%;
  max-width: calc(640px + 2 * var(--gutter));
  padding-top: clamp(8px, 3vw, 32px);
  padding-bottom: clamp(48px, 8vw, 80px);
  line-height: 1.5;
}

.account section:not(#account-view) {
  max-width: 400px;
  margin: 0 auto;
}

.legal.account h1 {
  font-size: clamp(28px, 4vw, 32px);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.legal.account .updated {
  margin: 8px 0 24px;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.legal.account h2 {
  margin: 40px 0 8px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 18px;
}

.legal.account p,
.legal.account li {
  font-size: 15px;
}

.legal.account p + p {
  margin-top: 8px;
}

.legal.account .account-loading {
  color: var(--text-faint);
}

.account-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.account-head .updated {
  margin-bottom: 0;
}

.account .download {
  width: auto;
  min-width: 0;
  height: 44px;
  padding: 0 16px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 15px;
  cursor: pointer;
}

.account .download:not(.download--secondary) {
  border: 0;
}

.account .download:disabled {
  opacity: 0.4;
  cursor: default;
}

.account .account-small {
  height: 40px;
  font-size: 14px;
  flex-shrink: 0;
  white-space: nowrap;
}

.account-form {
  display: grid;
  gap: 16px;
}

.account-form label {
  display: grid;
  gap: 8px;
}

.account-form label span {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dim);
}

.account-form input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--white);
  font: inherit;
  font-size: 16px;
}

.account-form input:focus {
  outline: none;
  border-color: var(--blue);
}

.account .account-form .download,
.account .account-google {
  width: 100%;
}

.account-form .download {
  margin-top: 8px;
}

.legal.account .account-links {
  margin: 8px 0 0;
  list-style: none;
}

.legal.account .account-links li {
  margin: 0;
}

.account-links li + li {
  border-top: 1px solid var(--line);
}

.legal.account .account-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  color: var(--white);
  font-size: 15px;
  text-decoration: none;
}

.account-links a::after {
  content: "\203A";
  font-size: 20px;
  color: var(--text-faint);
}

.account-links a:hover {
  opacity: 0.75;
}

.legal.account .account-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  font-size: 13px;
  color: var(--text-faint);
}

.account-divider::before,
.account-divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--line);
}

.account .account-delete {
  background: #ef4444;
  color: var(--white);
}

.legal.account .account-error {
  font-size: 14px;
  color: #f87171;
}

.legal.account .account-notice {
  font-size: 14px;
  color: var(--blue);
}

#verify-banner {
  margin-top: 24px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
}

.legal.account .account-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 28px;
  font-size: 14px;
  color: var(--text-dim);
}

.legal.account .account-switch + .account-switch {
  margin-top: 8px;
}

.account-link-gap {
  display: block;
  margin-top: 16px;
}

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--blue);
  font: inherit;
  cursor: pointer;
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.legal.account .account-actions + .account-error,
.legal.account #app-done,
.legal.account #start-error {
  margin-top: 16px;
}

@media (max-width: 520px) {
  .account-actions .download {
    flex: 1 1 100%;
  }

  .page-footer {
    flex-direction: column;
  }
}
