/* Glass: the sign-in on the shards, the overview dashboard, and the frosted
   surfaces every page shares. Loaded after app.css. Palette and tokens live there. */

/* ---- Frosted surfaces ---------------------------------------------------------------- */

.gl, .fcard, .notice, .kpi, .stat, .mod:not(.mod--off) {
  position: relative;
  background: var(--glass-bg), var(--panel);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--glass-shadow);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}
.gl { border-radius: var(--rc); }
/* The light follows the pointer across the glass (motion.js sets --mx/--my). */
.gl::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(440px circle at var(--mx, 50%) var(--my, -30%), rgba(255, 255, 255, .075), transparent 46%);
  opacity: 0; transition: opacity .35s var(--ease-out);
}
.gl:hover::after { opacity: 1; }

/* ---- Sign in: a glass card on lit shards ------------------------------------------------ */

.gate {
  position: relative; min-height: 100vh; display: grid; place-items: center; padding: 48px 20px; overflow: hidden;
  background: #050a1a; color: #F5F7FB; --muted: #93A3BC; --faint: #68799A; --bad: #EF5D6B;
}
.gate__bg { position: absolute; inset: 0; }
.gate__bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 90% at 50% 45%, transparent 40%, rgba(3, 6, 16, .78)); pointer-events: none; }
.shards { display: block; width: 100%; height: 100%; }
.shards .glow { animation: breathe 9s ease-in-out infinite alternate; }
.shards .glow--b { animation-duration: 13s; animation-direction: alternate-reverse; }
@keyframes breathe { from { opacity: .62; } to { opacity: 1; } }
.sh {
  transform-box: fill-box; transform-origin: center;
  translate: calc(var(--px, 0) * var(--d) * -18px) calc(var(--py, 0) * var(--d) * -12px);
  transition: translate 1s var(--spring);
  animation: shard-in 1.4s var(--ease) both; animation-delay: var(--delay);
}
.sh polygon:first-child { stroke-width: 1.3; stroke-linejoin: round; }
.sh--cool polygon:first-child { stroke: rgba(142, 164, 223, .18); }
.sh--warm polygon:first-child { stroke: rgba(244, 214, 176, .15); }
.sh--hot polygon:first-child { stroke: rgba(224, 190, 114, .65); }
.sh--hot { filter: drop-shadow(0 0 8px rgba(224, 190, 114, .5)); }
.sh__lit { fill: rgba(255, 255, 255, .055); }
.sh__dark { fill: rgba(0, 0, 0, .22); }
@keyframes shard-in { from { opacity: 0; transform: translate(var(--from)) scale(.9) rotate(-3deg); } to { opacity: 1; transform: none; } }

.gate__card {
  position: relative; z-index: 1; width: min(980px, 100%); min-height: 540px; display: grid; grid-template-columns: 1fr 1fr;
  border-radius: 28px; overflow: hidden; isolation: isolate;
  background: linear-gradient(150deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .025) 55%), rgba(11, 19, 43, .4);
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 60px 140px -40px rgba(0, 0, 0, .9);
  backdrop-filter: blur(22px) saturate(160%); -webkit-backdrop-filter: blur(22px) saturate(160%);
  animation: card-in 1.1s .3s var(--ease) both;
}
/* A glint runs across the glass every few seconds. */
.gate__card::before {
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: linear-gradient(112deg, transparent 38%, rgba(255, 255, 255, .07) 48%, rgba(255, 255, 255, .02) 52%, transparent 60%);
  transform: translateX(-120%); animation: glint 8s 1.6s ease-in-out infinite;
}
@keyframes card-in { from { opacity: 0; transform: translateY(22px) scale(.975); } to { opacity: 1; transform: none; } }
@keyframes glint { 0%, 55% { transform: translateX(-120%); } 85%, 100% { transform: translateX(120%); } }

.gate__form { position: relative; z-index: 2; display: grid; align-content: center; padding: 56px 52px; }
.gate__stack { display: grid; gap: 16px; }
.gate__k { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: #E0BE72; }
.gate h1 { font-family: var(--display); font-weight: 400; font-size: 50px; line-height: 1; letter-spacing: -.01em; }
.gate__lede { color: #C3CCDA; font-size: 15px; max-width: 36ch; }
.gate__field { display: grid; gap: 6px; }
.gate__field span { font-size: 12.5px; color: var(--muted); }
.gate__field input, .gate__recrow input {
  width: 100%; border: 0; border-bottom: 1px solid rgba(255, 255, 255, .22); background: transparent; color: #F5F7FB;
  padding: 10px 2px; font-size: 15px; transition: border-color .2s var(--spring);
}
.gate__field input:focus, .gate__recrow input:focus { outline: none; border-color: #E0BE72; }
.gate__go {
  margin-top: 8px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 54px; padding: 0 26px;
  border: 0; border-radius: 999px; cursor: pointer; font: 600 15.5px/1 var(--sans); color: #0B132B;
  background: linear-gradient(180deg, #E0BE72, #C9A24E);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 14px 34px -10px rgba(201, 162, 78, .75);
  transition: transform .35s var(--spring), box-shadow .2s var(--spring), filter .2s var(--spring);
}
.gate__go:hover { transform: translateY(-2px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 20px 44px -10px rgba(201, 162, 78, .9); }
.gate__go:active { transform: translateY(0); filter: brightness(.95); }
.gate__go[disabled] { opacity: .55; cursor: wait; transform: none; }
.gate__go:focus-visible { outline: 2px solid #F4D6B0; outline-offset: 3px; }
.gate .err { color: var(--bad); font-size: 14px; min-height: 20px; }
.gate__rec summary { cursor: pointer; color: var(--muted); font-size: 13.5px; width: max-content; }
.gate__rec summary:hover { color: #F5F7FB; }
.gate__rec[open] summary { margin-bottom: 10px; }
.gate__recrow { display: flex; gap: 10px; align-items: end; }
.gate__recrow button {
  flex: none; border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .06); color: #F5F7FB;
  border-radius: 999px; padding: 9px 16px; cursor: pointer; font-weight: 500;
}
.gate__recrow button:hover { border-color: #E0BE72; }
.gate__facts { list-style: none; margin: 10px 0 0; padding: 16px 0 0; border-top: 1px solid rgba(255, 255, 255, .1); display: grid; gap: 7px; color: var(--muted); font-size: 12.5px; }
.gate__facts li { display: flex; gap: 9px; align-items: baseline; }
.gate__facts li::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #8EA4DF; flex: none; transform: translateY(-2px); }

/* The welcome pane, cut on the diagonal like the edge of a pane of glass. */
.gate__hello {
  position: relative; z-index: 1; margin-left: -14%; padding: 56px 52px 44px calc(14% + 40px);
  display: flex; flex-direction: column; justify-content: center; gap: 14px;
  clip-path: polygon(16% 0, 100% 0, 100% 100%, 0 100%);
  background:
    radial-gradient(90% 70% at 100% 0%, rgba(142, 164, 223, .2), transparent 60%),
    radial-gradient(80% 70% at 30% 110%, rgba(201, 162, 78, .22), transparent 60%),
    linear-gradient(160deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .02));
}
.gate__hello::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 16%; pointer-events: none;
  background: linear-gradient(to top right, transparent calc(50% - 1px), rgba(255, 255, 255, .32), transparent calc(50% + 1px));
}
.gate__mark { height: 72px; width: auto; margin-bottom: 10px; }
.gate__hello h2 { font-family: var(--display); font-weight: 400; font-size: 54px; line-height: .98; letter-spacing: -.01em; }
.gate__hello p { color: #D4DAE4; font-size: 17px; max-width: 22ch; }
.gate__tag { margin-top: auto; padding-top: 28px; font-size: 12.5px; color: var(--muted); }
.gate__tag em { font-style: normal; color: #F4D6B0; }

/* ---- Type: Unbounded is wide, so titles come down a size and tighten up ---------------- */

.gate h1 { font-size: 40px; font-weight: 600; letter-spacing: -.04em; }
.gate__hello h2 { font-size: 44px; font-weight: 600; letter-spacing: -.045em; line-height: 1; }
.page-h h1, .yard-head h1 { font-size: clamp(28px, 3vw, 40px); font-weight: 500; letter-spacing: -.035em; }
.lead h1 { font-size: clamp(28px, 3.2vw, 44px); font-weight: 600; letter-spacing: -.04em; line-height: 1.06; }
.verdict h2 { font-size: 24px; font-weight: 500; letter-spacing: -.03em; }
.dlg h2 { font-size: 22px; font-weight: 500; letter-spacing: -.03em; }
.fcard h3 { font-size: 20px; font-weight: 500; letter-spacing: -.03em; }
.yname { font-size: 17px; font-weight: 500; letter-spacing: -.02em; }
.kpi b, .stat b { font-family: var(--display); font-weight: 500; letter-spacing: -.045em; }
.kpi b, .stat b { font-size: 20px; line-height: 1.3; }
.sb-brand b { font-family: var(--display); font-weight: 600; letter-spacing: -.03em; font-size: 15px; }
.gate__k { letter-spacing: .06em; }

/* ---- Light version ----------------------------------------------------------------------- */

:root[data-theme="light"] .gl::after { background: radial-gradient(440px circle at var(--mx, 50%) var(--my, -30%), rgba(255, 255, 255, .6), transparent 46%); }

/* ---- Smaller screens ------------------------------------------------------------------- */

@media (max-width: 900px) {
  .gate__card { grid-template-columns: 1fr; min-height: 0; }
  .gate__hello { order: -1; margin: 0; padding: 34px 28px 26px; clip-path: none; gap: 8px; }
  .gate__hello::before { display: none; }
  .gate__hello h2 { font-size: 32px; }
  .gate__hello p { font-size: 15px; max-width: none; }
  .gate__mark { height: 64px; width: auto; margin-bottom: 6px; }
  .gate__tag { display: none; }
  .gate__form { padding: 30px 28px 36px; }
  .gate h1 { font-size: 32px; }
}
@media (max-width: 640px) {
  .gate { padding: 20px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  body::before, .gate__card::before { animation: none !important; }
  .sh { translate: none; }
}
