@font-face {
  font-family: "Open Sauce Sans";
  src: url("/fonts/OpenSauceSans-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Peace Sans";
  src: url("/fonts/PeaceSans.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  background: var(--landscape-base, #acc5c5);
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
}

.background {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
}

canvas.background {
  image-rendering: pixelated;
  opacity: 0.25;
}

.inside-page {
  position: relative;
  z-index: 1;
  padding: max(40px, env(safe-area-inset-top)) 24px 0;
  text-align: center;
}

.inside-page h1 {
  margin: 0;
  color: #fff;
  font: 400 12vw/1 "Peace Sans", sans-serif;
  letter-spacing: -0.04em;
  -webkit-mask-image: repeating-conic-gradient(#000 0% 25%, rgba(0, 0, 0, 0.4) 0% 50%);
  mask-image: repeating-conic-gradient(#000 0% 25%, rgba(0, 0, 0, 0.4) 0% 50%);
  -webkit-mask-size: 4px 4px;
  mask-size: 4px 4px;
}

.tools-textbox {
  --textbox-fill: rgba(250, 248, 244, 0.75);
  --textbox-dither: rgba(57, 51, 44, 0.07);
  --send-fill: #171917;
  --send-ink: #faf8f4;
  position: fixed;
  top: 73.5%;
  left: 50%;
  z-index: 3;
  width: min(54vw, 1100px);
  transform: translate(-50%, -50%);
}

.tools-textbox textarea {
  box-sizing: border-box;
  display: block;
  width: 100%;
  height: clamp(76px, 9vh, 124px);
  padding: 18px 64px 18px 22px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background-color: var(--textbox-fill);
  background-image: repeating-conic-gradient(var(--textbox-dither) 0% 25%, transparent 0% 50%);
  background-size: 3px 3px;
  color: var(--text);
  box-shadow: 0 6px 24px rgba(10, 25, 40, 0.12);
  font: 400 16px/1.6 "Open Sauce Sans", sans-serif;
  caret-color: currentColor;
  resize: none;
}

[data-theme="dark"] .tools-textbox {
  --textbox-fill: rgba(11, 18, 27, 0.75);
  --textbox-dither: rgba(207, 224, 241, 0.1);
  --send-fill: #f5f5f0;
  --send-ink: #101923;
}
.tools-textbox textarea:focus { outline: 1px solid var(--focus); outline-offset: 2px; }

.tools-send-icon {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--send-ink);
  cursor: pointer;
  transition: color 950ms cubic-bezier(0.4, 0, 0.2, 1);
}

.tools-send-icon::before {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background-color: var(--send-fill);
  -webkit-mask-image: repeating-conic-gradient(#000 0% 25%, rgba(0, 0, 0, 0.6) 0% 50%);
  mask-image: repeating-conic-gradient(#000 0% 25%, rgba(0, 0, 0, 0.6) 0% 50%);
  -webkit-mask-size: 3px 3px;
  mask-size: 3px 3px;
  transition: background-color 950ms cubic-bezier(0.4, 0, 0.2, 1);
  content: "";
}

.tools-send-icon svg { position: relative; width: 19px; height: 19px; }
.tools-send-icon:disabled { cursor: default; }
.tools-send-icon:disabled svg { opacity: 0.55; }
.tools-send-icon:focus-visible { outline: 1px solid var(--text); outline-offset: 4px; }
.tools-textbox[aria-busy="true"] .tools-send-icon { animation: capture-pulse 900ms ease-in-out infinite alternate; }
@keyframes capture-pulse { from { opacity: 0.45; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .tools-send-icon, .tools-send-icon::before { transition: none; animation: none !important; }
}

@media (max-width: 600px) {
  .tools-textbox { width: calc(100% - 48px); }
  .tools-textbox textarea { padding: 14px 60px 14px 18px; }
}

.orb-scene {
  --feedback-width: min(480px, calc(100vw - 48px));
  --feedback-height: 132px;
  position: fixed;
  inset: 0;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  animation: orb-float 5s ease-in-out infinite;
}

.orb-scene.is-ready {
  opacity: 1;
}

.orb-shadow {
  position: absolute;
  left: var(--orb-x);
  top: var(--shadow-y);
  width: clamp(52px, 6vw, 88px);
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(16, 29, 38, 0.48), transparent 72%);
  filter: blur(3px);
  transform: translate(-50%, -50%);
  animation: orb-shadow-float 5s ease-in-out infinite;
}

.tool-orb {
  position: absolute;
  left: var(--orb-x);
  top: var(--orb-y);
  width: var(--orb-size, clamp(44px, 4.5vw, 64px));
  height: var(--orb-size, clamp(44px, 4.5vw, 64px));
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  transform: translate(-50%, -50%);
  transition: transform 220ms ease,
    width 650ms cubic-bezier(0.22, 1, 0.36, 1),
    height 650ms cubic-bezier(0.22, 1, 0.36, 1),
    border-radius 650ms cubic-bezier(0.22, 1, 0.36, 1);
  filter: drop-shadow(3px 8px 7px rgba(46, 62, 71, 0.22));
  -webkit-tap-highlight-color: transparent;
}

.tool-orb:hover {
  transform: translate(-50%, -50%) scale(1.08);
}

.tool-orb:active {
  transform: translate(-50%, -50%) scale(0.96);
}

.tool-orb:focus-visible {
  outline: 1px solid white;
  outline-offset: 8px;
}

.orb-surface {
  --ring-width: clamp(3px, 0.4vw, 5px);
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0.75;
  overflow: hidden;
  border-radius: inherit;
  background:
    radial-gradient(ellipse at 28% 20%, rgba(255, 255, 255, 0.95), transparent 45%),
    radial-gradient(circle at 35% 30%, #fff 8%, #edf2f1 38%, #c1cfd2 70%, #7e969d 100%);
  box-shadow:
    inset 1px 1px 2px rgba(255, 255, 255, 0.95),
    inset -5px -7px 10px rgba(70, 96, 108, 0.24);
  -webkit-mask-image:
    radial-gradient(farthest-side, transparent calc(100% - var(--ring-width)), #000 calc(100% - var(--ring-width) + 0.5px)),
    repeating-conic-gradient(#000 0% 25%, rgba(0, 0, 0, 0.55) 0% 50%);
  mask-image:
    radial-gradient(farthest-side, transparent calc(100% - var(--ring-width)), #000 calc(100% - var(--ring-width) + 0.5px)),
    repeating-conic-gradient(#000 0% 25%, rgba(0, 0, 0, 0.55) 0% 50%);
  -webkit-mask-size: 100% 100%, 3px 3px;
  mask-size: 100% 100%, 3px 3px;
  -webkit-mask-repeat: no-repeat, repeat;
  mask-repeat: no-repeat, repeat;
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}

.orb-surface::before {
  position: absolute;
  top: 12%;
  left: 18%;
  width: 43%;
  height: 19%;
  border-radius: 50%;
  background: linear-gradient(180deg, #fff, rgba(255, 255, 255, 0.2));
  filter: blur(0.6px);
  transform: rotate(-35deg);
  content: "";
}

.orb-surface::after {
  position: absolute;
  right: 13%;
  bottom: 9%;
  left: 15%;
  height: 24%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 213, 170, 0.8), transparent 72%);
  filter: blur(2px);
  transform: rotate(-15deg);
  content: "";
}

.orb-scene.is-responding { animation-play-state: paused; }
.orb-scene.is-responding .tool-orb {
  width: var(--feedback-width);
  height: var(--feedback-height);
  aspect-ratio: auto;
  border-radius: 16px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.orb-scene.is-responding .orb-surface {
  opacity: 0.95;
  background: var(--page-background);
  box-shadow: inset 0 0 0 1px var(--border);
  -webkit-mask-image: repeating-conic-gradient(#000 0% 25%, rgba(0, 0, 0, 0.82) 0% 50%);
  mask-image: repeating-conic-gradient(#000 0% 25%, rgba(0, 0, 0, 0.82) 0% 50%);
  -webkit-mask-size: 3px 3px;
  mask-size: 3px 3px;
  -webkit-mask-repeat: repeat;
  mask-repeat: repeat;
  -webkit-mask-composite: source-over;
  mask-composite: add;
}
.orb-scene.is-responding .orb-surface::before,
.orb-scene.is-responding .orb-surface::after { opacity: 0; }
.orb-scene.is-responding .orb-shadow { opacity: 0; animation: none; }

.orb-feedback {
  position: absolute;
  left: var(--orb-x);
  top: var(--orb-y);
  box-sizing: border-box;
  width: var(--feedback-width);
  min-height: 132px;
  max-height: var(--feedback-height);
  padding: 26px 44px 24px 26px;
  overflow: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
  color: var(--text);
  font: 400 15px/1.6 "Open Sauce Sans", sans-serif;
  transform: translate(-50%, -50%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 160ms ease, visibility 0s 160ms;
}
.orb-feedback[hidden] { display: none; }
.orb-scene.is-responding .orb-feedback {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 240ms ease 220ms, visibility 0s;
}
.orb-feedback p { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.capture-feedback-actions { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; }
.orb-feedback a, .orb-feedback button { color: inherit; font: inherit; }
.capture-feedback-actions a, .capture-feedback-actions button {
  padding: 0;
  border: 0;
  background: none;
  text-decoration: underline;
  text-underline-offset: 4px;
  font-size: 12px;
  cursor: pointer;
}
.orb-feedback [hidden] { display: none; }
#capture-dismiss { position: absolute; right: 12px; top: 10px; width: 28px; height: 28px; padding: 0; border: 0; background: none; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; }
.orb-feedback button:focus-visible, .orb-feedback a:focus-visible { outline: 1px solid currentColor; outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  .orb-feedback, .orb-scene.is-responding .orb-feedback { transition: none; }
}

.orb-connection {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  -webkit-mask-image: repeating-conic-gradient(#000 0% 25%, rgba(0, 0, 0, 0.4) 0% 50%);
  mask-image: repeating-conic-gradient(#000 0% 25%, rgba(0, 0, 0, 0.4) 0% 50%);
  -webkit-mask-size: 3px 3px;
  mask-size: 3px 3px;
}

.orb-connection path {
  fill: none;
  stroke: url(#orb-line-fade);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  opacity: 0;
  transition: stroke-dashoffset 550ms cubic-bezier(0.22, 1, 0.36, 1), opacity 180ms ease;
}

.orb-label {
  position: absolute;
  left: var(--label-x);
  top: var(--label-y);
  width: clamp(44px, 4vw, 64px);
  aspect-ratio: 1;
  margin: 0;
  color: white;
  text-decoration: none;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, calc(-50% + 6px));
  transition: opacity 240ms ease, transform 400ms ease, visibility 400ms;
  -webkit-mask-image: repeating-conic-gradient(#000 0% 25%, rgba(0, 0, 0, 0.4) 0% 50%);
  mask-image: repeating-conic-gradient(#000 0% 25%, rgba(0, 0, 0, 0.4) 0% 50%);
  -webkit-mask-size: 3px 3px;
  mask-size: 3px 3px;
}

#notes-connection { stroke: url(#notes-line-fade); }
#spend-connection { stroke: url(#spend-line-fade); }
#calendar-connection { stroke: url(#calendar-line-fade); }

.orb-label svg {
  display: block;
  width: 100%;
  height: 100%;
}

.orb-label:focus-visible {
  outline: 1px solid white;
  outline-offset: 8px;
  border-radius: 8px;
}

.orb-scene.is-open .orb-connection path {
  stroke-dashoffset: 0;
  opacity: 0.75;
}

.orb-scene.is-open .orb-label {
  opacity: 0.75;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, -50%);
  transition-delay: 240ms;
}

.call-handler-page {
  min-height: 100svh;
  background: var(--page-background);
}

.call-handler-page h1 {
  color: var(--text);
}

.call-handler-page::before {
  position: fixed;
  inset: 0;
  background-image: repeating-conic-gradient(var(--grain) 0% 25%, transparent 0% 50%);
  background-size: 3px 3px;
  pointer-events: none;
  content: "";
}

@keyframes orb-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes orb-shadow-float {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.65;
  }
  50% {
    transform: translate(-50%, calc(-50% + 10px)) scale(1.15);
    opacity: 0.4;
  }
}

.page-content {
  position: fixed;
  top: 32%;
  right: 0;
  left: 0;
  z-index: 1;
  display: flex;
  justify-content: center;
  padding: 0 24px;
  transform: translateY(-50%);
}

.text-field {
  box-sizing: border-box;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--field-border);
  border-radius: 16px;
  background: var(--field-fill);
  box-shadow:
    inset 0 1px 0 var(--field-highlight),
    0 4px 8px rgba(45, 39, 60, 0.06),
    0 12px 28px rgba(45, 39, 60, 0.08);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.access-form {
  position: relative;
  width: min(100%, 340px);
}

.form-status {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  margin: 12px 0 0;
  color: var(--field-text);
  font: 400 13px/1.5 "Instrument Sans", sans-serif;
  text-align: center;
}

.text-input:disabled {
  opacity: 0.65;
}

.text-field:focus-within {
  border-color: var(--field-focus);
  box-shadow:
    0 0 0 3px rgba(248, 247, 250, 0.25),
    0 8px 24px rgba(45, 39, 60, 0.1);
}

.text-input {
  box-sizing: border-box;
  display: block;
  width: 100%;
  height: 52px;
  padding: 0 20px;
  border: 0;
  border-radius: 0;
  outline: none;
  background: transparent;
  color: var(--field-text);
  font: 400 16px/1.5 "Instrument Sans", sans-serif;
  letter-spacing: -0.02em;
  caret-color: var(--field-text);
  appearance: none;
}

.text-input::placeholder {
  color: #85818c;
  opacity: 1;
  transition: opacity 180ms ease;
}

.text-input:focus::placeholder {
  opacity: 0.45;
}

@media (prefers-reduced-motion: reduce) {
  .text-field,
  .text-input::placeholder,
  .tool-orb,
  .orb-label,
  .orb-connection path {
    transition: none;
  }

  .orb-scene,
  .orb-shadow {
    animation: none;
  }
}

@media (forced-colors: active) {
  .text-input:focus-visible {
    outline: 1px solid Highlight;
  }
}

