/* call.sending.ac. Brand values from sending.ac (site/pages/_shell.html, _person.html). The card is light, like the
   site; the in-call view is dark, like a phone's call screen. */
@font-face { font-family: "Inter Display"; src: url("/assets/fonts/InterDisplay-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter Display"; src: url("/assets/fonts/InterDisplay-SemiBold.woff2") format("woff2"); font-weight: 600 700; font-display: swap; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100svh; color: #3F3F46; font: 400 1rem/1.5 "Inter Display", ui-sans-serif, system-ui, sans-serif;
  background: #FDFDFB radial-gradient(ellipse 80% 45% at 50% 0%, rgba(245,206,62,.18), transparent 70%) no-repeat;
  display: flex; justify-content: center;
}
body.in-call { overflow: hidden; }
::selection { background: #F5CE3E; color: #09090b; }
a { color: inherit; }
:focus-visible { outline: 2px solid #B4820D; outline-offset: 3px; }
[hidden] { display: none !important; }

/* ── the card ── */
.card {
  width: 100%; max-width: 460px; min-height: 100svh; display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: calc(40px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom));
}
.mark img { display: block; height: 28px; width: auto; opacity: .92; }
h1 { margin: 36px 0 0; font-size: clamp(2rem, 9vw, 2.75rem); font-weight: 700; letter-spacing: -.04em; line-height: 1.06; color: #0B1E45; }
.sub { margin: 10px 0 0; font-size: 1.0625rem; line-height: 1.45; color: #6B6B75; }

.as { margin: 4px 0 0; font-size: .875rem; color: rgba(255,255,255,.45); }
.rows { width: 100%; margin: 32px 0 0; display: flex; flex-direction: column; gap: 12px; }

/* A number is the main tap target: flag, country, the number in large type, and a gold call button. */
.row {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px 16px 16px 18px;
  border-radius: 18px; border: 1px solid #EFE9DA; background: #fff; color: #0B1E45; text-decoration: none; text-align: left;
  box-shadow: 0 1px 2px rgba(93,78,19,.04), 0 18px 36px -26px rgba(93,78,19,.45);
  transition: transform .2s cubic-bezier(.2,.7,.3,1), box-shadow .2s, border-color .2s;
  -webkit-tap-highlight-color: transparent;
}
.row:hover { transform: translateY(-2px); border-color: #E3B81F; box-shadow: 0 1px 2px rgba(93,78,19,.06), 0 20px 36px -22px rgba(93,78,19,.45); }
.row:active { transform: translateY(0) scale(.99); }
.flag { flex: none; width: 36px; height: 24px; border-radius: 5px; box-shadow: 0 0 0 1px rgba(11,30,69,.08); object-fit: cover; }
.flag-none { background: #FDF3CF; }
.lbl { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.where { font-size: .8125rem; font-weight: 400; color: #726D63; line-height: 1.3; }
.note { white-space: nowrap; }
.num { font-size: clamp(1.25rem, 5.6vw, 1.5rem); font-weight: 600; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; white-space: nowrap; }
.go {
  flex: none; width: 46px; height: 46px; border-radius: 999px; display: grid; place-items: center;
  background: #F5CE3E linear-gradient(180deg, rgba(255,255,255,.42), rgba(255,255,255,0)); border: 1px solid #E3B81F; color: #3F2E04;
  box-shadow: 0 5px 12px -8px rgba(180,130,13,.45), inset 0 1px 0 rgba(255,255,255,.55);
}
.go svg { width: 20px; height: 20px; fill: currentColor; }

.msg { margin: 16px 0 0; font-size: .9375rem; color: #6B5310; }
.ts:empty { display: none; }
.ts { display: flex; justify-content: center; margin-top: 12px; }

/* The browser call: a plain link at the bottom. */
.web { margin: 28px 0 0; font-size: .9375rem; color: #6B6B75; }
.link { padding: 4px 2px; border: 0; background: none; font: inherit; font-weight: 600; color: #0B1E45; text-decoration: underline; text-decoration-color: #E3B81F; text-underline-offset: 4px; text-decoration-thickness: 2px; cursor: pointer; }
.link:disabled { cursor: progress; opacity: .6; }

footer { margin-top: auto; padding-top: 40px; font-size: .75rem; line-height: 1.6; color: #726D63; }
footer p { margin: 0; }
footer a { color: #6B6B75; }

/* ── the in-call view: a phone's call screen ── */
.incall {
  position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: calc(64px + env(safe-area-inset-top)) 24px calc(48px + env(safe-area-inset-bottom));
  color: #fff; background: radial-gradient(ellipse 90% 60% at 50% 0%, #1B3266 0%, #0B1E45 45%, #05070D 100%);
  animation: rise .28s cubic-bezier(.2,.7,.3,1);
}
.incall.leaving { animation: fall .3s ease-in forwards; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes fall { to { opacity: 0; transform: translateY(16px); } }
.who h2 { margin: 0; font-size: 2.125rem; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; }
.state { margin: 8px 0 0; font-size: 1.0625rem; color: rgba(255,255,255,.62); font-variant-numeric: tabular-nums; }
.avatar {
  margin: 36px 0 0; width: 104px; height: 104px; border-radius: 999px; display: grid; place-items: center;
  background: linear-gradient(180deg, #FBE58E, #F5CE3E); box-shadow: 0 0 0 10px rgba(245,206,62,.10);
}
.avatar svg { width: 62px; height: 62px; }
.incall[data-phase="ringing"] .avatar, .incall[data-phase="calling"] .avatar { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 18px rgba(245,206,62,.04); } }

.keys { margin-top: auto; display: flex; justify-content: center; gap: 28px; }
.key { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0; border: 0; background: none; color: #fff; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.disc { width: 76px; height: 76px; border-radius: 999px; display: grid; place-items: center; background: rgba(255,255,255,.16); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); transition: background .15s, color .15s; }
.disc svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.disc .off { display: none; }
.key[aria-pressed="true"] .disc { background: #fff; color: #0B1E45; }
.key[aria-pressed="true"] .disc .on { display: none; }
.key[aria-pressed="true"] .disc .off { display: grid; }
.key:disabled { opacity: .4; cursor: default; }
.cap { font-size: .8125rem; color: rgba(255,255,255,.85); }

.end-wrap { margin-top: 40px; }
.end {
  width: 76px; height: 76px; border-radius: 999px; border: 0; display: grid; place-items: center; cursor: pointer;
  background: #FF3B30; color: #fff; box-shadow: 0 10px 30px -10px rgba(255,59,48,.7); -webkit-tap-highlight-color: transparent;
}
.end svg { width: 34px; height: 34px; fill: currentColor; transform: rotate(135deg); }
.end:active { filter: brightness(.9); }

@media (max-width: 360px) { .row { padding: 14px 12px 14px 14px; gap: 12px; } .go { width: 40px; height: 40px; } }
@media (prefers-reduced-motion: reduce) { .row, .incall, .avatar { transition: none; animation: none !important; } }
