/* loopdaloop.me — the app's dim spaceship console, on the web.
   Tokens mirror App/Sources/UI/Theme.swift in the app repo. */
:root {
  --space-top: #0B0C1E;
  --space-bottom: #04141C;
  --teal: #59E6D9;
  --amber: #FF9E40;
  --danger: #FF5961;
  --lilac: #C79EFF;
  --text: rgba(255, 255, 255, .92);
  --dim: rgba(255, 255, 255, .5);
  --glass: rgba(255, 255, 255, .045);
  --glass-edge: rgba(255, 255, 255, .14);
  --round: ui-rounded, "SF Pro Rounded", "Nunito", "Varela Round", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { background: var(--space-bottom); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font: 500 16px/1.5 var(--round);
  color: var(--text);
  background: linear-gradient(180deg, var(--space-top), var(--space-bottom)) fixed;
  -webkit-font-smoothing: antialiased;
}

#biff-bar { min-height: 37px; position: relative; z-index: 2; }

/* The breathing sky: a slow teal glow, like the bar pulse in the app. */
.sky {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(60vmax 60vmax at 50% 18%, rgba(89, 230, 217, .10), transparent 70%),
    radial-gradient(40vmax 40vmax at 85% 80%, rgba(199, 158, 255, .05), transparent 70%);
  animation: breathe 5s ease-in-out infinite;
}
@keyframes breathe { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }

.top, main, .foot { position: relative; z-index: 1; }

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- header ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 1040px; margin: 0 auto; padding: 14px 16px;
}
.wordmark { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 20px; color: var(--text); letter-spacing: -.01em; }
.wordmark:hover { text-decoration: none; }
.mark {
  width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle, #fff 0 12%, var(--teal) 30%, rgba(89, 230, 217, .15) 62%, transparent 64%);
  box-shadow: 0 0 0 1.5px rgba(89, 230, 217, .55), 0 0 14px rgba(89, 230, 217, .6);
}
.top nav { display: flex; align-items: center; gap: 14px; }
.navlink { color: var(--dim); font-size: 14px; font-weight: 600; white-space: nowrap; }
.navlink:hover { color: var(--text); text-decoration: none; }

main { max-width: 1040px; margin: 0 auto; padding: 8px 16px 40px; }
section { margin: 0 0 44px; }

h1, h2 { font-weight: 700; letter-spacing: -.02em; line-height: 1.12; margin: 0 0 14px; }
h1 { font-size: clamp(28px, 6vw, 40px); }
h2 { font-size: 21px; color: var(--text); }
.lede { color: rgba(255, 255, 255, .72); font-size: 17px; margin: 0 0 20px; }
.dim { color: var(--dim); }
.small { font-size: 13px; }
.teal { color: var(--teal); }
.center { text-align: center; }

/* ---------- glass ---------- */
.panel {
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  border-color: rgba(255, 255, 255, .18) rgba(255, 255, 255, .1) rgba(255, 255, 255, .04);
  border-radius: 18px;
  padding: 20px;
}
.narrow { max-width: 480px; margin-left: auto; margin-right: auto; }

/* ---------- pads (the app's capsule keys) ---------- */
.pads { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 18px; }
.center-pads { justify-content: center; }
.pad {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: 600 13px/1 var(--round); color: var(--text);
  padding: 10px 14px; border-radius: 999px; cursor: pointer;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .14);
  transition: transform .22s cubic-bezier(.3, 1.8, .5, 1), box-shadow .2s, background .2s;
  -webkit-tap-highlight-color: transparent; white-space: nowrap;
}
.pad:hover { text-decoration: none; background: rgba(255, 255, 255, .12); }
.pad:active { transform: scale(.88) rotate(-1.5deg); }
.pad-big { font-size: 15px; padding: 14px 22px; }
.pad-small { font-size: 12px; padding: 8px 12px; }
.pad-teal { color: var(--teal); background: rgba(89, 230, 217, .13); border-color: rgba(89, 230, 217, .4); }
.pad-teal:hover { background: rgba(89, 230, 217, .2); }
.pad-solid { color: var(--space-top); background: var(--teal); border-color: var(--teal); box-shadow: 0 0 14px rgba(89, 230, 217, .4); }
.pad-solid:hover { background: #7df0e5; box-shadow: 0 0 22px rgba(89, 230, 217, .6); }
.pad-active { color: var(--space-top); background: rgba(255, 255, 255, .92); border-color: #fff; }
.pad-active:hover { background: #fff; }
.pad-danger { color: var(--danger); background: rgba(255, 89, 97, .1); border-color: rgba(255, 89, 97, .4); }
form { margin: 0; }

.readout {
  font: 500 12px/1 var(--round); font-variant-numeric: tabular-nums; color: rgba(255, 255, 255, .75);
  padding: 8px 12px; border-radius: 999px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1);
}
.readout.amber { color: var(--amber); border-color: rgba(255, 158, 64, .35); }

/* ---------- hero ---------- */
.hero { text-align: center; padding: 6px 0 10px; }
.hero h1 { font-size: clamp(38px, 10vw, 68px); font-weight: 800; margin-bottom: 16px; }
.hero h1 em { font-style: normal; color: var(--teal); text-shadow: 0 0 34px rgba(89, 230, 217, .45); }
.hero .lede { max-width: 520px; margin-left: auto; margin-right: auto; }
.hero-orb { width: min(280px, 62vw); margin: 0 auto -6px; }
.orb { display: block; width: 100%; height: auto; }

/* ---------- cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 12px; margin-bottom: 20px; }
.card {
  display: flex; flex-direction: column; gap: 3px; padding: 10px 12px 12px; color: var(--text);
  background: var(--glass); border: 1px solid rgba(255, 255, 255, .1); border-radius: 12px;
  transition: transform .22s cubic-bezier(.3, 1.6, .5, 1), border-color .2s, background .2s;
}
.card:hover { text-decoration: none; transform: translateY(-3px); border-color: rgba(89, 230, 217, .45); background: rgba(255, 255, 255, .07); }
.card-kind { font-size: 10px; font-weight: 700; letter-spacing: .1em; color: var(--teal); margin: 0; }
.card-title { font-weight: 700; font-size: 15px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-meta { font-size: 12px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { color: var(--dim); text-align: center; padding: 34px 16px; border: 1px dashed rgba(89, 230, 217, .4); border-radius: 12px; }

/* A scene drawn as a constellation: one LED star per orb. */
.constellation { position: relative; height: 84px; margin-bottom: 6px; }
.constellation.big { height: 150px; }
.constellation i {
  position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%;
  background: radial-gradient(circle, #fff 0 14%, var(--c) 42%, transparent 72%);
  box-shadow: 0 0 12px var(--c), 0 0 0 1px color-mix(in srgb, var(--c) 45%, transparent);
  animation: twinkle 3.2s ease-in-out infinite;
}
.constellation i:nth-child(2n) { animation-delay: -1.1s; }
.constellation i:nth-child(3n) { animation-delay: -2.2s; }
@keyframes twinkle { 0%, 100% { transform: scale(1); opacity: .85; } 50% { transform: scale(1.22); opacity: 1; } }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 12px; }
.steps .panel p { margin: 6px 0 0; color: rgba(255, 255, 255, .7); font-size: 15px; }

.shots { display: flex; gap: 14px; overflow-x: auto; padding: 4px 0 18px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.shots::-webkit-scrollbar { display: none; }
.shots img { flex: 0 0 auto; width: min(240px, 62vw); height: auto; border-radius: 22px; scroll-snap-align: center; box-shadow: 0 0 40px rgba(89, 230, 217, .16); }
@media (min-width: 800px) { .shots { justify-content: center; } }

/* ---------- a share ---------- */
.share { max-width: 560px; margin: 0 auto 44px; text-align: center; }
.stage { position: relative; width: min(360px, 82vw); margin: 0 auto; }
.play {
  position: absolute; left: 50%; top: 50%; width: 84px; height: 84px; margin: -42px 0 0 -42px;
  border-radius: 50%; border: 0; cursor: pointer; background: var(--teal);
  box-shadow: 0 0 26px rgba(89, 230, 217, .6); -webkit-tap-highlight-color: transparent;
  transition: transform .22s cubic-bezier(.3, 1.8, .5, 1), box-shadow .2s;
}
.play:hover { box-shadow: 0 0 40px rgba(89, 230, 217, .85); }
.play:active { transform: scale(.86); }
.icon-play { display: block; margin: 0 auto; width: 0; height: 0; border-style: solid; border-width: 15px 0 15px 25px; border-color: transparent transparent transparent var(--space-top); transform: translateX(4px); }
.playing .icon-play { width: 24px; height: 28px; border: 0; transform: none; background: linear-gradient(90deg, var(--space-top) 0 36%, transparent 36% 64%, var(--space-top) 64%); }
.playing .play { background: rgba(89, 230, 217, .9); }

.scrub { display: flex; align-items: center; gap: 10px; margin: 2px auto 18px; max-width: 420px; }
.time { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--dim); min-width: 34px; }
input[type=range] { flex: 1; appearance: none; -webkit-appearance: none; height: 22px; background: transparent; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .16); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .16); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 10px rgba(89, 230, 217, .7); }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: var(--teal); box-shadow: 0 0 10px rgba(89, 230, 217, .7); }

.share h1 { margin: 4px 0 6px; overflow-wrap: anywhere; }
.byline { color: var(--dim); margin: 0 0 14px; font-size: 14px; }
.desc { color: rgba(255, 255, 255, .78); white-space: pre-line; overflow-wrap: anywhere; margin: 0 0 18px; }
.readouts { margin-bottom: 14px; }
.cta { display: flex; align-items: center; justify-content: space-between; gap: 14px; text-align: left; margin: 24px 0 16px; }
.cta p { margin: 0; font-size: 15px; color: rgba(255, 255, 255, .8); }

/* ---------- profile ---------- */
.profile { text-align: center; margin-bottom: 22px; }
.profile h1 { margin-bottom: 4px; }
.avatar {
  display: block; width: 76px; height: 76px; margin: 0 auto 14px; border-radius: 50%;
  background: radial-gradient(circle, #fff 0 9%, var(--teal) 26%, rgba(89, 230, 217, .12) 60%, transparent 62%);
  box-shadow: 0 0 0 2px rgba(89, 230, 217, .5), 0 0 30px rgba(89, 230, 217, .5);
}

/* ---------- forms ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, .7); }
.form small { font-weight: 500; color: var(--dim); }
input[type=text], input[type=email], select, textarea {
  font: 500 16px/1.3 var(--round); color: var(--text); width: 100%;
  padding: 12px 14px; border-radius: 12px; outline: none;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .16);
}
select { appearance: none; -webkit-appearance: none; }
select option { color: #111; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(89, 230, 217, .18); }
::placeholder { color: rgba(255, 255, 255, .3); }
.form .check { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 500; font-size: 14px; line-height: 1.4; color: rgba(255, 255, 255, .82); cursor: pointer; }
.check input { flex: 0 0 auto; width: 20px; height: 20px; margin: 0; accent-color: var(--teal); }
.form .pad { align-self: flex-start; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.error { color: var(--danger); background: rgba(255, 89, 97, .1); border: 1px solid rgba(255, 89, 97, .35); border-radius: 12px; padding: 10px 14px; margin: 0 0 14px; font-size: 14px; }
.ok { color: var(--teal); background: rgba(89, 230, 217, .1); border: 1px solid rgba(89, 230, 217, .35); border-radius: 12px; padding: 10px 14px; margin: 0 0 14px; font-size: 14px; }
.danger-zone { margin-top: 22px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .08); }
.danger-zone p { margin: 0; }

.rows { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: 12px; flex-wrap: wrap; }
.row .pads { margin: 0; }
.row-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 200px; }
.row-title { color: var(--text); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- long text ---------- */
.prose { max-width: 720px; margin: 0 auto; padding: 26px 22px; }
.prose h2 { margin-top: 30px; font-size: 19px; }
.prose p, .prose li { color: rgba(255, 255, 255, .8); }
.prose ul { padding-left: 20px; }
.prose li { margin-bottom: 6px; }
.prose blockquote { margin: 12px 0; padding: 12px 16px; border-left: 3px solid var(--teal); background: rgba(89, 230, 217, .07); border-radius: 0 12px 12px 0; color: var(--text); }
.prose table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 12px 0; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 9px 10px; border-bottom: 1px solid rgba(255, 255, 255, .08); color: rgba(255, 255, 255, .8); }
.prose th { color: var(--dim); font-size: 12px; letter-spacing: .06em; font-weight: 700; }
.prose td:first-child { font-weight: 700; color: var(--text); width: 30%; }

/* ---------- footer ---------- */
.foot { max-width: 1040px; margin: 0 auto; padding: 22px 16px 44px; text-align: center; font-size: 13px; border-top: 1px solid rgba(255, 255, 255, .06); }
.foot p { margin: 0 0 8px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; }
.foot a { color: var(--dim); }
.foot a:hover { color: var(--text); }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 5;
  padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 600;
  color: var(--space-top); background: var(--teal); box-shadow: 0 0 22px rgba(89, 230, 217, .5);
}

@media (max-width: 520px) {
  .top { gap: 8px; }
  .top nav { gap: 10px; }
  .wordmark { font-size: 17px; gap: 7px; }
  .navlink { font-size: 13px; }
  .top .pad { padding: 9px 12px; }
  .cta { flex-direction: column; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  .sky, .constellation i { animation: none; }
  .pad, .card, .play { transition: none; }
}
