:root {
  --bg: #0b0820;
  --bg-2: #120d2e;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.075);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #f4f2ff;
  --muted: #a29dc4;
  --faint: #6f6a93;

  --brand-1: #8b6cf6;
  --brand-2: #4a2bd0;

  --studio-1: #9b7bff;
  --studio-2: #5b7cff;
  --flow-1: #2be0c4;
  --flow-2: #18a7e8;

  --radius: 22px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: radial-gradient(1200px 700px at 50% -10%, #1d1450 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow-x: hidden;
}
button, select, input { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); margin: 2px 0 0; font-size: .92rem; }

/* ---------- animated background ---------- */
.aurora { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5; animation: drift 22s ease-in-out infinite alternate; }
.b1 { width: 520px; height: 520px; background: var(--brand-1); top: -160px; left: -120px; }
.b2 { width: 460px; height: 460px; background: var(--flow-2); bottom: -180px; right: -140px; opacity: .28; animation-duration: 28s; }
.b3 { width: 380px; height: 380px; background: var(--brand-2); top: 40%; left: 55%; opacity: .35; animation-duration: 34s; }
@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 40px) scale(1.12); }
  100% { transform: translate(-40px, 80px) scale(.95); }
}
.grain {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .06;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(16px, 4vw, 40px);
  background: linear-gradient(to bottom, rgba(11, 8, 32, .85), rgba(11, 8, 32, .4));
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-mark { width: 38px; height: 32px; filter: drop-shadow(0 4px 14px rgba(139, 108, 246, .55)); }
.brand-text {
  font-weight: 800; font-size: 1.15rem; letter-spacing: -.01em;
  background: linear-gradient(90deg, #c9b8ff, #8b6cf6 60%, #7a5cff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.clock {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  font-variant-numeric: tabular-nums; font-weight: 600; font-size: .92rem;
}
.clock-dot { width: 8px; height: 8px; border-radius: 50%; background: #3ee08f; box-shadow: 0 0 0 0 rgba(62, 224, 143, .6); animation: ping 2s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 9px rgba(62, 224, 143, 0); } 100% { box-shadow: 0 0 0 0 rgba(62, 224, 143, 0); } }

/* ---------- layout ---------- */
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px) 40px; }

.reveal { opacity: 0; transform: translateY(18px); animation: rise .8s var(--ease) forwards; animation-delay: var(--d, 0s); }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- hero ---------- */
.hero { text-align: center; padding: clamp(36px, 7vw, 72px) 0 clamp(24px, 4vw, 40px); }
.eyebrow {
  display: inline-block; margin: 0 0 14px; padding: 6px 14px; border-radius: 999px;
  font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: #cbbcff; background: rgba(139, 108, 246, .14); border: 1px solid rgba(139, 108, 246, .35);
}
.hero h1 {
  margin: 0; font-size: clamp(2.6rem, 8vw, 4.6rem); line-height: 1.02; letter-spacing: -.035em; font-weight: 800;
  background: linear-gradient(180deg, #fff 30%, #b9a8ff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-date { margin: 10px 0 22px; color: var(--muted); font-size: clamp(1rem, 2.4vw, 1.2rem); font-weight: 500; }

.day-nav { display: inline-flex; align-items: center; gap: 8px; }
.icon-btn, .pill-btn {
  border: 1px solid var(--border); background: var(--surface); cursor: pointer;
  transition: background .25s var(--ease), border-color .25s var(--ease), transform .2s var(--ease);
}
.icon-btn { width: 42px; height: 42px; border-radius: 50%; font-size: 1.4rem; line-height: 1; display: grid; place-items: center; padding-bottom: 3px; }
.pill-btn { height: 42px; padding: 0 18px; border-radius: 999px; font-weight: 600; font-size: .9rem; }
.icon-btn:hover, .pill-btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.icon-btn:active, .pill-btn:active { transform: scale(.94); }
.pill-btn[disabled] { opacity: .45; cursor: default; }
.day-nav.small .icon-btn { width: 36px; height: 36px; font-size: 1.2rem; }
.day-nav.small .pill-btn { height: 36px; padding: 0 14px; font-size: .85rem; }
:focus-visible { outline: 2px solid #b9a8ff; outline-offset: 3px; }

/* ---------- spotlight cards ---------- */
.spotlight { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-bottom: 22px; }
.tool-card {
  --a: var(--studio-1); --b: var(--studio-2);
  position: relative; overflow: hidden; isolation: isolate;
  padding: clamp(20px, 3vw, 30px); border-radius: calc(var(--radius) + 6px);
  background: linear-gradient(160deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02));
  border: 1px solid var(--border);
  transition: transform .5s var(--ease), border-color .5s var(--ease);
}
.tool-card.flow { --a: var(--flow-1); --b: var(--flow-2); }
.tool-card::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; padding: 1px;
  background: conic-gradient(from var(--angle, 0deg), transparent 0 60%, var(--a), var(--b), transparent 90%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: spin 6s linear infinite;
}
@property --angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
@keyframes spin { to { --angle: 360deg; } }
.tool-card:hover { transform: translateY(-4px); }
.tool-glow {
  position: absolute; z-index: -2; width: 340px; height: 340px; border-radius: 50%;
  top: -150px; right: -120px; filter: blur(70px); opacity: .45;
  background: radial-gradient(circle, var(--a), transparent 70%);
  animation: breathe 5s ease-in-out infinite;
}
@keyframes breathe { 50% { opacity: .7; transform: scale(1.1); } }

.tool-head { display: flex; align-items: center; gap: 14px; }
.tool-head h2 { margin: 0; font-size: clamp(1.25rem, 2.6vw, 1.6rem); letter-spacing: -.02em; }
.tool-sub { margin: 0; color: var(--muted); font-size: .85rem; }
.tool-icon {
  flex: none; width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--a), var(--b));
  box-shadow: 0 10px 30px -8px var(--a);
}
.tool-icon svg { width: 26px; height: 26px; fill: #fff; }
.flow .tool-icon svg { fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.live-tag {
  margin-left: auto; flex: none; padding: 5px 11px; border-radius: 999px;
  font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: #0b0820; background: linear-gradient(135deg, var(--a), var(--b));
}
.live-tag.off { color: var(--muted); background: var(--surface-2); }

.holders { display: grid; gap: 14px; margin: clamp(22px, 4vw, 34px) 0 18px; min-height: 72px; align-content: center; }
.holder { display: flex; align-items: center; gap: 16px; }
.holders.pair { gap: 10px; margin-top: clamp(16px, 3vw, 24px); }
.holders.pair .avatar { width: 54px; height: 54px; font-size: 1.1rem; }
.holders.pair .holder-name { font-size: clamp(1.25rem, 2.8vw, 1.6rem); }
.holders.pair .holder + .holder .holder-label { display: none; }
.holder.is-me .holder-label::after {
  content: "You"; margin-left: 8px; padding: 1px 8px; border-radius: 999px; letter-spacing: .06em;
  color: #0b0820; background: #fff;
}
.avatar {
  flex: none; width: 72px; height: 72px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: 1.5rem; color: #fff;
  background: linear-gradient(135deg, var(--a), var(--b));
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .06), 0 14px 40px -10px var(--a);
}
.holder-text { min-width: 0; }
.holder-label { margin: 0; color: var(--muted); font-size: .82rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; }
.holder-name { margin: 2px 0 0; font-size: clamp(1.5rem, 3.6vw, 2.2rem); font-weight: 800; letter-spacing: -.025em; line-height: 1.15; overflow-wrap: anywhere; }
.tool-next { margin: 0; padding-top: 16px; border-top: 1px solid var(--border); color: var(--muted); font-size: .9rem; }
.tool-next strong { color: var(--text); font-weight: 600; }

.swap-out { animation: swapOut .22s var(--ease) forwards; }
.swap-in { animation: swapIn .5s var(--ease) forwards; }
@keyframes swapOut { to { opacity: 0; transform: translateY(-10px); filter: blur(4px); } }
@keyframes swapIn { from { opacity: 0; transform: translateY(12px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }

/* ---------- panels ---------- */
.panel {
  margin-bottom: 22px; padding: clamp(18px, 3vw, 28px); border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.panel-head h3 { margin: 0; font-size: 1.2rem; letter-spacing: -.015em; }

.select select, .search input {
  height: 44px; min-width: 240px; padding: 0 16px; border-radius: 14px;
  background: rgba(0, 0, 0, .25); border: 1px solid var(--border-strong);
  transition: border-color .25s var(--ease);
}
.select select { appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8'><path d='M1 1l5 5 5-5' stroke='%23b9a8ff' stroke-width='2' fill='none'/></svg>");
  background-repeat: no-repeat; background-position: right 16px center; }
.select select option { background: var(--bg-2); }
.select select:hover, .search input:focus { border-color: #8b6cf6; outline: none; }

/* ---------- my schedule ---------- */
.me-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 16px; animation: swapIn .5s var(--ease); }
.me-status {
  padding: 22px; border-radius: 18px; border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(139, 108, 246, .2), rgba(74, 43, 208, .08));
}
.me-status.studio { background: linear-gradient(135deg, rgba(155, 123, 255, .32), rgba(91, 124, 255, .12)); }
.me-status.flow { background: linear-gradient(135deg, rgba(43, 224, 196, .25), rgba(24, 167, 232, .1)); }
.me-status .big { margin: 6px 0 4px; font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.me-status .small { margin: 0; color: var(--muted); font-size: .9rem; }
.me-upcoming { display: grid; gap: 8px; }
.up-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px;
  background: rgba(0, 0, 0, .18); border: 1px solid var(--border);
}
.up-date { flex: 1; min-width: 0; font-weight: 600; }
.up-date span { display: block; color: var(--muted); font-weight: 500; font-size: .82rem; }

.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap;
}
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.studio { color: #c7b6ff; background: rgba(155, 123, 255, .16); border: 1px solid rgba(155, 123, 255, .35); }
.chip.flow { color: #7cf1dc; background: rgba(43, 224, 196, .12); border: 1px solid rgba(43, 224, 196, .32); }
.chip.rest { color: var(--muted); background: var(--surface); border: 1px solid var(--border); }

/* ---------- week ---------- */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.day {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  padding: 14px 12px; border-radius: 16px; cursor: pointer; text-align: left;
  background: rgba(0, 0, 0, .18); border: 1px solid var(--border);
  opacity: 0; transform: translateY(10px); animation: rise .55s var(--ease) forwards;
  transition: border-color .25s var(--ease), background .25s var(--ease), transform .25s var(--ease);
}
.day:hover { border-color: var(--border-strong); background: rgba(255, 255, 255, .05); }
.day.selected { border-color: #8b6cf6; box-shadow: 0 0 0 1px #8b6cf6 inset; }
.day.today::after {
  content: "Today"; position: absolute; top: 12px; right: 10px;
  font-size: .64rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 999px; color: #0b0820; background: linear-gradient(135deg, var(--brand-1), #b9a8ff);
}
.day-name { font-weight: 700; font-size: .95rem; }
.day-date { color: var(--muted); font-size: .8rem; margin-top: -8px; }
.slot { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 11px; font-size: .84rem; }
.slot small { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; opacity: .8; }
.slot b { font-weight: 600; overflow-wrap: anywhere; line-height: 1.25; }
.slot.studio { background: rgba(155, 123, 255, .14); color: #ddd2ff; }
.slot.flow { background: rgba(43, 224, 196, .1); color: #b4f6ea; }
.slot b.mine { margin: 0 -4px; padding: 0 4px; border-radius: 6px; box-shadow: 0 0 0 1.5px #fff inset; }

/* ---------- students ---------- */
.students { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.student {
  display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 18px;
  background: rgba(0, 0, 0, .18); border: 1px solid var(--border);
  opacity: 0; transform: translateY(10px); animation: rise .55s var(--ease) forwards;
  transition: border-color .25s var(--ease), transform .25s var(--ease);
}
.student:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.student.mine { border-color: #8b6cf6; background: rgba(139, 108, 246, .1); }
.student-top { display: flex; align-items: center; gap: 12px; }
.mini-avatar {
  flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; font-size: .95rem; color: #fff; background: linear-gradient(135deg, #3a2f6e, #241c4d);
  border: 1px solid var(--border-strong);
}
.student.on-studio .mini-avatar { background: linear-gradient(135deg, var(--studio-1), var(--studio-2)); border: 0; }
.student.on-flow .mini-avatar { background: linear-gradient(135deg, var(--flow-1), var(--flow-2)); border: 0; }
.student-name { flex: 1; min-width: 0; font-weight: 700; overflow-wrap: anywhere; line-height: 1.25; }
.student-next { display: grid; gap: 4px; font-size: .84rem; color: var(--muted); }
.student-next b { color: var(--text); font-weight: 600; }
.empty { grid-column: 1 / -1; color: var(--muted); text-align: center; padding: 24px; }

/* ---------- footer ---------- */
.foot { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 10px 16px 40px; color: var(--faint); font-size: .85rem; text-align: center; }
.foot-mark { width: 24px; height: 20px; flex: none; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .week { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .spotlight { grid-template-columns: 1fr; }
  .me-body { grid-template-columns: 1fr; }
  .week { grid-template-columns: 1fr; }
  .day { display: grid; grid-template-columns: 92px minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 8px; }
  .day-date { margin-top: 0; grid-row: 2; grid-column: 1; align-self: start; }
  .day-name { align-self: end; }
  .day .slot { grid-row: 1 / span 2; }
  .day.today::after { position: static; grid-column: 1; grid-row: 3; justify-self: start; }
  .select, .search, .select select, .search input { width: 100%; min-width: 0; }
  .panel-head > div:first-child { flex: 1 1 100%; }
}
@media (max-width: 420px) {
  .brand-text { font-size: 1rem; }
  .clock { padding: 6px 10px; font-size: .82rem; }
  .avatar { width: 58px; height: 58px; font-size: 1.2rem; }
  .day { grid-template-columns: 74px minmax(0, 1fr) minmax(0, 1fr); padding: 12px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
