/* Enlighten Fitness: 80s aerobics theme. Display fonts are self-hosted (SIL OFL) so offline works. */
@font-face { font-family: "Titan One"; src: url("fonts/titan-one.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Kaushan Script"; src: url("fonts/kaushan-script.woff2") format("woff2"); font-display: swap; }

:root {
  --bg: #140428;
  --panel: #1f0a3c;
  --panel-2: #2c0f52;
  --line: #4b2180;
  --text: #fdf7ff;
  --muted: #cbb8ea;
  --pink: #ff2e88;
  --teal: #2ef2ff;
  --yellow: #ffd23f;
  --orange: #ff8a3d;
  --ink: #1b0533;
  --accent: var(--pink);
  --accent-ink: #1a0012;
  --radius: 14px;
  --display: "Titan One", "Arial Rounded MT Bold", system-ui, sans-serif;
  --script: "Kaushan Script", "Brush Script MT", cursive;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  margin: 0;
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
  /* Memphis-style confetti: squiggles, triangles, dots */
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240' fill='none' stroke-width='4' stroke-linecap='round' opacity='.16'%3E%3Cpath d='M20 40q10-14 20 0t20 0 20 0' stroke='%23ff2e88'/%3E%3Cpath d='M170 30l18 30h-36z' stroke='%232ef2ff'/%3E%3Ccircle cx='200' cy='150' r='6' fill='%23ffd23f' stroke='none'/%3E%3Cpath d='M40 170l14 14m0-14-14 14' stroke='%23ffd23f'/%3E%3Cpath d='M110 120q10-14 20 0t20 0' stroke='%232ef2ff'/%3E%3Cpath d='M150 205l16 16 16-16' stroke='%23ff2e88'/%3E%3Ccircle cx='90' cy='215' r='4' fill='%23ff2e88' stroke='none'/%3E%3C/svg%3E") 0 0 / 240px 240px,
    var(--bg);
}

a { color: var(--teal); }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

/* ---- hero: sunset, neon grid, airbrushed logo ---- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; justify-items: center; text-align: center;
  padding: calc(28px + env(safe-area-inset-top)) 12px 34px;
  border-bottom: 4px solid var(--pink);
  box-shadow: 0 4px 0 var(--teal);
}
.sky {
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(#0d0220 0%, #2a0750 38%, #6a0f6e 56%, #ff2e88 62%, #12022a 62.4%);
}
.sun {
  position: absolute; left: 50%; top: 4%;
  width: min(118vw, 940px); aspect-ratio: 1; transform: translateX(-50%);
  border-radius: 50%;
  background: linear-gradient(#ffe45c 10%, var(--orange) 45%, var(--pink) 80%);
  box-shadow: 0 0 60px rgba(255, 46, 136, 0.55);
  /* classic sliced lower half */
  -webkit-mask: linear-gradient(#000 0 34%, transparent 34%), repeating-linear-gradient(#000 0 13px, transparent 13px 19px);
  mask: linear-gradient(#000 0 34%, transparent 34%), repeating-linear-gradient(#000 0 13px, transparent 13px 19px);
}
.floor {
  position: absolute; left: -50%; right: -50%; top: 62%; bottom: -10%;
  background-image:
    linear-gradient(rgba(46, 242, 255, 0.75) 2px, transparent 2px),
    linear-gradient(90deg, rgba(255, 46, 136, 0.75) 2px, transparent 2px);
  background-size: 44px 30px;
  background-color: #12022a;
  transform: perspective(260px) rotateX(55deg);
  transform-origin: top;
}


.logo {
  position: relative; display: block; text-decoration: none;
  transform: rotate(-4deg);
  margin-top: 6px;
}
.logo-line {
  position: relative; display: block; isolation: isolate;
  font-family: var(--display); font-weight: 400; letter-spacing: 0.03em; line-height: 0.95;
  font-size: clamp(42px, 13.5vw, 124px);
  /* layer 1 (this element): dark inner outline */
  color: var(--ink); -webkit-text-stroke: 0.15em var(--ink);
}
.logo-line + .logo-line { margin-top: -0.02em; font-size: clamp(46px, 15vw, 136px); }
.logo-line::before, .logo-line::after { content: attr(data-text); position: absolute; inset: 0; }
/* layer 0: white rim with spray-paint overspray */
.logo-line::before {
  z-index: -1; color: #fff; -webkit-text-stroke: 0.27em #fff;
  text-shadow: 0 0 0.16em var(--pink), 0 0 0.4em var(--teal), 0 0 0.8em rgba(255, 46, 136, 0.7);
}
/* layer 2: airbrushed fill, hot gloss spot over a yellow, orange, pink fade */
.logo-line::after {
  z-index: 1; -webkit-text-stroke: 0;
  background:
    radial-gradient(ellipse 26% 20% at 26% 28%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 70%),
    radial-gradient(ellipse 18% 14% at 74% 30%, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0) 70%),
    linear-gradient(#fff7b0 0%, var(--yellow) 24%, var(--orange) 52%, var(--pink) 80%, #c0187a 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
}

.sparkle {
  position: absolute; color: #fff; font-size: clamp(18px, 5vw, 44px); line-height: 1;
  text-shadow: 0 0 8px #fff, 0 0 18px var(--teal);
  animation: twinkle 2.4s ease-in-out infinite;
}
.s1 { top: 4%; left: 6%; }
.s2 { top: 44%; right: 2%; animation-delay: 0.8s; }
.s3 { bottom: 4%; left: 30%; font-size: clamp(12px, 3.4vw, 28px); animation-delay: 1.6s; }
@keyframes twinkle { 0%, 100% { opacity: 1; transform: scale(1) rotate(0); } 50% { opacity: 0.35; transform: scale(0.6) rotate(45deg); } }

.tagline {
  margin: 18px 0 0; transform: rotate(-3deg);
  font-family: var(--script); font-size: clamp(21px, 6vw, 42px); line-height: 1.15;
  color: var(--teal);
  text-shadow: 3px 3px 0 var(--ink), 0 0 14px rgba(46, 242, 255, 0.85), 0 0 30px rgba(46, 242, 255, 0.45);
}

@media (max-width: 599px) {
  .hero { padding-top: calc(52px + env(safe-area-inset-top)); }
}

/* compact hero on exercise pages */
.is-detail .hero { padding: calc(14px + env(safe-area-inset-top)) 12px 16px; }
.is-detail .logo { display: flex; gap: 0.25em; margin: 0; padding-right: 56px; }
.is-detail .logo-line, .is-detail .logo-line + .logo-line { font-size: clamp(22px, 6.4vw, 48px); margin: 0; }
.is-detail .tagline, .is-detail .sparkle, .is-detail .sun { display: none; }
.is-detail .sky { background: linear-gradient(#0d0220, #2a0750 60%, #6a0f6e); }
.is-detail .floor { top: 70%; }

/* ---- intro: dancing cone ---- */
.intro { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; align-content: center; gap: 6px; overflow: hidden; cursor: pointer; transition: opacity 0.4s ease; }
.intro.out { opacity: 0; }
.intro-sky { position: absolute; inset: 0; z-index: -1; overflow: hidden; background: linear-gradient(#0d0220 0%, #2a0750 40%, #b0207a 62%, #12022a 62.2%); }
.intro-sky::before {
  content: ""; position: absolute; left: 50%; top: 30%; width: min(110vw, 620px); aspect-ratio: 1; transform: translateX(-50%); border-radius: 50%;
  background: linear-gradient(#ffe45c 10%, var(--orange) 45%, var(--pink) 80%); box-shadow: 0 0 80px rgba(255, 46, 136, 0.6);
}
.intro-sky::after {
  content: ""; position: absolute; left: -50%; right: -50%; top: 62%; bottom: -20%;
  background-color: #12022a;
  background-image: linear-gradient(rgba(46, 242, 255, 0.75) 2px, transparent 2px), linear-gradient(90deg, rgba(255, 46, 136, 0.75) 2px, transparent 2px);
  background-size: 50px 34px; transform: perspective(300px) rotateX(55deg); transform-origin: top;
}
.cone-dancer { width: min(62vw, 300px); height: auto; overflow: visible; animation: bounce 0.5s ease-in-out infinite alternate; transform-origin: 50% 90%; }
.cone-dancer .arm-l { transform-origin: 80px 176px; animation: wave-l 0.5s ease-in-out infinite alternate; }
.cone-dancer .arm-r { transform-origin: 160px 176px; animation: wave-r 0.5s ease-in-out infinite alternate; }
.cone-dancer .leg-l { transform-origin: 110px 282px; animation: kick-l 0.5s ease-in-out infinite alternate; }
.cone-dancer .leg-r { transform-origin: 130px 282px; animation: kick-r 0.5s ease-in-out infinite alternate; }
.cone-dancer .scoop { transform-origin: 120px 150px; animation: bob 1s ease-in-out infinite alternate; }
@keyframes bounce { 0% { transform: translateY(0) rotate(-6deg); } 100% { transform: translateY(-22px) rotate(6deg); } }
@keyframes wave-l { 0% { transform: rotate(-25deg); } 100% { transform: rotate(45deg); } }
@keyframes wave-r { 0% { transform: rotate(-45deg); } 100% { transform: rotate(25deg); } }
@keyframes kick-l { 0% { transform: rotate(0); } 100% { transform: rotate(28deg); } }
@keyframes kick-r { 0% { transform: rotate(-28deg); } 100% { transform: rotate(0); } }
@keyframes bob { 0% { transform: rotate(-5deg); } 100% { transform: rotate(5deg); } }
.intro-shout {
  margin: 0; font: 400 clamp(34px, 10vw, 72px)/1 var(--display); color: var(--yellow); transform: rotate(-4deg);
  -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; text-shadow: 4px 4px 0 var(--pink), 0 0 24px rgba(255, 46, 136, 0.8);
  animation: pulse 0.5s ease-in-out infinite alternate;
}
@keyframes pulse { to { transform: rotate(-4deg) scale(1.08); } }
.intro-skip { margin: 4px 0 0; color: #fff; opacity: 0.75; font-weight: 700; font-size: 14px; }

@media (min-width: 720px) {
  .tiles { grid-template-columns: repeat(4, 1fr); }
  .tile { min-height: 150px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
  .sparkle, .cone-dancer, .cone-dancer *, .intro-shout, .sheet, .sheet-backdrop { animation: none !important; }
}

/* ---- shared bits ---- */
main { max-width: 720px; margin: 0 auto; padding: 18px 16px 96px; outline: none; }
.loading, .empty { color: var(--muted); text-align: center; padding: 48px 16px; }
.page-title { margin: 0 0 12px; font: 400 26px/1.15 var(--display); color: var(--yellow); text-shadow: 3px 3px 0 var(--ink); }
.panel { background: var(--panel); border: 3px solid var(--ink); border-radius: var(--radius); padding: 16px; box-shadow: 5px 5px 0 var(--teal); margin-bottom: 18px; display: grid; gap: 12px; }
.panel h2 { margin: 0; font: 400 19px/1.2 var(--display); color: var(--teal); }
.panel p { margin: 0; }
.field { display: grid; gap: 4px; font-size: 14px; color: var(--muted); font-weight: 700; min-width: 0; }
.field input, .field textarea {
  width: 100%; min-height: 48px; padding: 11px 12px; font: inherit; font-size: 16px; font-weight: 500; /* 16px keeps iOS from zooming on focus */
  background: var(--panel-2); color: var(--text); border: 2px solid #8a63c4; border-radius: 10px;
}
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 12px rgba(46, 242, 255, 0.45); }
.check { display: flex; gap: 10px; align-items: center; min-height: 44px; font-weight: 600; }
.check input { width: 24px; height: 24px; accent-color: var(--pink); }
.hint { color: var(--muted); font-size: 14px; margin: 0; }
.error { color: #ff9dc2; font-weight: 700; margin: 0; min-height: 1.2em; }
.ok { color: var(--teal); font-weight: 700; margin: 0; min-height: 1.2em; }
.btn-big {
  display: block; width: 100%; min-height: 48px; padding: 13px 18px; border-radius: 12px; border: 3px solid var(--ink);
  font: 400 18px/1.2 var(--display); letter-spacing: 0.03em; color: var(--ink); text-align: center; text-decoration: none; cursor: pointer;
  background: linear-gradient(90deg, var(--yellow), var(--orange)); box-shadow: 4px 4px 0 var(--ink);
}
.btn-big:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.btn-big.alt { background: var(--teal); }
.btn-big.danger { background: #ff9dc2; }
.btn-big:disabled { opacity: 0.6; }
.back-link { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: 6px; color: var(--teal); font-weight: 700; text-decoration: none; }
.login { max-width: 420px; margin: 10px auto 40px; }
.login .page-title { text-align: center; }
.linkbox { overflow-wrap: anywhere; font-size: 14px; padding: 10px 12px; background: var(--panel-2); border-radius: 10px; }

.client-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; padding: 10px 14px; margin-bottom: 10px;
  color: var(--text); text-decoration: none; background: var(--panel); border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: 3px 3px 0 var(--pink);
}
.client-row strong { font-size: 17px; overflow-wrap: anywhere; }
.pill { flex: none; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--ink); background: var(--yellow); }

.tabbar {
  position: fixed; inset: auto 0 0; z-index: 10; display: flex; justify-content: center; gap: 4px;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: var(--panel); border-top: 3px solid var(--pink);
}
.tabbar a { flex: 1; max-width: 200px; display: grid; place-items: center; min-height: 48px; color: var(--muted); text-decoration: none; font-weight: 700; border-radius: 10px; }
.tabbar a[aria-current] { color: var(--yellow); background: rgba(255, 46, 136, 0.18); }

/* Large-text mode: everything in the app area scales, tap targets included. */
html.large main, html.large .tabbar { zoom: 1.25; }
