/*
 * Xenodyne visual refresh, phase 1: typography + motion polish.
 * Loaded AFTER app.css and institutional.css. Remove its <link> line to undo.
 * Fonts are self-hosted (the site policy only allows same-origin fonts).
 * Put the font files in /assets/fonts/ (see fonts-setup.txt). If a file is
 * missing, the browser quietly falls back to the old font stack.
 */

@font-face {
  font-family: "Inter";
  src: local("Inter Variable"), url("/assets/fonts/inter.woff2") format("woff2"), url("/assets/fonts/inter.ttf") format("truetype");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: local("Space Grotesk"), url("/assets/fonts/space-grotesk.woff2") format("woff2"), url("/assets/fonts/space-grotesk.ttf") format("truetype");
  font-weight: 300 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: local("JetBrains Mono"), url("/assets/fonts/jetbrains-mono.woff2") format("woff2"), url("/assets/fonts/jetbrains-mono.ttf") format("truetype");
  font-weight: 100 800; font-style: normal; font-display: swap;
}

:root {
  --font-body: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", Inter, ui-sans-serif, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

html { text-rendering: optimizeLegibility; font-optical-sizing: auto; scrollbar-color: rgba(11, 191, 138, .55) transparent; }
body { font-family: var(--font-body); font-feature-settings: "cv11", "calt"; }

/* Headlines get the display face, slightly looser than the old Inter tracking. */
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -.035em; }
h1 { font-weight: 600; }
h2 { font-weight: 600; }

/* Technical labels use the mono face. */
.eyebrow, code, kbd, samp, pre { font-family: var(--font-mono); }
.eyebrow { letter-spacing: .14em; }

/* Keyboard focus that is easy to see. */
:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; border-radius: 6px; }

/* Links inside reading content get an underline that draws in. */
main p a:not(.button), main li a:not(.button) {
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size .35s var(--ease);
}
main p a:not(.button):hover, main li a:not(.button):hover { background-size: 100% 1px; }

/* Buttons feel more alive without changing their layout. */
.button { transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-radius .35s var(--ease), background-color .25s ease; }

/* Scroll reveal: pure CSS, only in browsers that support scroll-driven animation. */
@media (prefers-reduced-motion: no-preference) {
  @keyframes xnd-rise {
    from { opacity: 0; transform: translateY(26px); }
    to { opacity: 1; transform: none; }
  }
  @supports (animation-timeline: view()) {
    main h2, main .lead, main .eyebrow, main [data-reveal] {
      animation: xnd-rise linear both;
      animation-timeline: view();
      animation-range: entry 5% cover 28%;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}


/* ==========================================================================
 * Phase 2: identity login pages (student, staff, educator, officials)
 * Pure CSS on top of the existing markup. Needs /assets/img/xenodyne-logo.svg
 * ========================================================================== */

/* Your logo becomes the glowing core of the orbit (replaces the letter X). */
.auth-orbit span {
  display: block; width: 40%; aspect-ratio: 1; font-size: 0; color: transparent;
  background: url("/assets/img/xenodyne-logo.svg") center / contain no-repeat;
  filter: drop-shadow(0 0 34px rgba(224, 37, 37, .38)) drop-shadow(0 0 90px rgba(98, 246, 199, .12));
}

/* Left side: label, headline, attempt meter. */
.auth-orbit { top: 7%; right: 6%; width: min(30vw, 360px); }
.identity-auth-scene h1 {
  font-size: clamp(2.8rem, 5vw, 5.4rem); letter-spacing: -.045em; line-height: .98; text-wrap: balance; max-width: 11em;
}

/* The eight attempts read as a warning scale: calm first, then escalating locks. */
.attempt-scale i { background: rgba(98, 246, 199, .5); }
.attempt-scale i:nth-child(5) { background: var(--amber); }
.attempt-scale i:nth-child(6) { background: #ffa24a; }
.attempt-scale i:nth-child(7) { background: #ff7f5c; }
.attempt-scale i:nth-child(8) { background: var(--red); }

/* Right side: the sign-in card. */
.identity-auth-shell .login-panel {
  background:
    radial-gradient(circle at 85% 8%, rgba(98, 246, 199, .22), transparent 34%),
    radial-gradient(circle at 8% 92%, rgba(121, 184, 255, .2), transparent 36%),
    linear-gradient(145deg, #f7faf9, #e6f0ec);
}
.identity-auth-shell .login-card {
  position: relative; border-radius: 28px;
  box-shadow: 0 40px 90px rgba(5, 40, 32, .16), 0 2px 0 rgba(255, 255, 255, .9) inset;
}
.identity-auth-shell .login-card::before {
  content: ""; position: absolute; inset: 0 34px auto 34px; height: 3px; border-radius: 0 0 6px 6px;
  background: linear-gradient(90deg, var(--mint), var(--blue));
}
.identity-auth-shell .login-card > .eyebrow { margin-bottom: 18px; }
.identity-auth-shell .login-card > .eyebrow::before {
  width: 34px; height: 34px; background: url("/assets/img/xenodyne-logo.svg") center / contain no-repeat;
}
.identity-auth-shell .login-card h2 { margin-bottom: 10px; }

/* Inputs and buttons. */
.identity-auth-shell form:not(.hide) { display: grid; gap: 18px; }
.identity-auth-shell .field { margin: 0; }
.identity-auth-shell .text-link { padding: 0; border: 0; background: none; cursor: pointer; }
.identity-auth-shell .field input {
  min-height: 50px; border-radius: 14px; background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(7, 19, 16, .12);
  transition: border-color .25s ease, box-shadow .25s ease, background-color .25s ease;
}
.identity-auth-shell .field input:focus {
  outline: none; border-color: var(--mint-strong); background: #fff;
  box-shadow: 0 0 0 4px rgba(98, 246, 199, .28);
}
.identity-auth-shell .form-actions { flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.identity-auth-shell .form-actions .button { flex: 1 1 100%; }
.identity-auth-shell .form-actions .button-dark {
  background: linear-gradient(135deg, #07111b, #12303a);
  box-shadow: 0 14px 30px rgba(7, 17, 27, .22);
}
.identity-auth-shell .form-actions .button-dark:hover { box-shadow: 0 16px 38px rgba(11, 191, 138, .35); }

/* Entrance motion. */
@media (prefers-reduced-motion: no-preference) {
  @keyframes xnd-card-in { from { opacity: 0; transform: translateY(26px) scale(.985); } to { opacity: 1; transform: none; } }
  @keyframes xnd-field-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
  @keyframes xnd-attempt { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
  .identity-auth-shell .login-card { animation: xnd-card-in .85s var(--ease) both; }
  .identity-auth-shell form:not(.hide) .field { animation: xnd-field-in .6s var(--ease) both; }
  .identity-auth-shell form:not(.hide) .field:nth-of-type(1) { animation-delay: .15s; }
  .identity-auth-shell form:not(.hide) .field:nth-of-type(2) { animation-delay: .22s; }
  .identity-auth-shell form:not(.hide) .field:nth-of-type(3) { animation-delay: .29s; }
  .identity-auth-shell form:not(.hide) .field:nth-of-type(4) { animation-delay: .36s; }
  .attempt-scale i { animation: xnd-attempt 3.6s ease-in-out infinite; }
  .attempt-scale i:nth-child(2) { animation-delay: .15s; } .attempt-scale i:nth-child(3) { animation-delay: .3s; }
  .attempt-scale i:nth-child(4) { animation-delay: .45s; } .attempt-scale i:nth-child(5) { animation-delay: .6s; }
  .attempt-scale i:nth-child(6) { animation-delay: .75s; } .attempt-scale i:nth-child(7) { animation-delay: .9s; }
  .attempt-scale i:nth-child(8) { animation-delay: 1.05s; }
}


/* ==========================================================================
 * Phase 2b: glass surfaces + extra motion on the identity login pages
 * ========================================================================== */

/* Frosted dark glass behind the headline. */
.identity-auth-scene .login-copy {
  padding: clamp(1.6rem, 3vw, 2.8rem); border-radius: 30px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .085), rgba(255, 255, 255, .02));
  border: 1px solid rgba(255, 255, 255, .11);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  box-shadow: inset 0 1px rgba(255, 255, 255, .14), 0 30px 80px rgba(0, 0, 0, .38);
}

/* Light panel: colour blobs drift behind the card so the glass has something to blur. */
.identity-auth-shell .login-panel { position: relative; overflow: hidden; isolation: isolate; }
.identity-auth-shell .login-panel::before,
.identity-auth-shell .login-panel::after {
  content: ""; position: absolute; z-index: -1; border-radius: 50%; filter: blur(40px); pointer-events: none;
}
.identity-auth-shell .login-panel::before { width: 340px; height: 340px; left: 6%; top: 10%; background: rgba(98, 246, 199, .5); }
.identity-auth-shell .login-panel::after { width: 300px; height: 300px; right: 4%; bottom: 8%; background: rgba(121, 184, 255, .5); }

/* The card becomes real glass. */
.identity-auth-shell .login-card {
  overflow: hidden;
  background: linear-gradient(150deg, rgba(255, 255, 255, .74), rgba(255, 255, 255, .42));
  border: 1px solid rgba(255, 255, 255, .7);
  backdrop-filter: blur(26px) saturate(170%);
  -webkit-backdrop-filter: blur(26px) saturate(170%);
}
.identity-auth-shell .login-card::after {
  content: ""; position: absolute; inset: -20% auto -20% -60%; width: 40%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent);
  transform: skewX(-18deg) translateX(0); opacity: 0;
}
.identity-auth-shell .field:focus-within label { color: var(--mint-dark); }
.identity-auth-shell .form-actions .button-dark { background-size: 220% 100%; }
.identity-auth-shell .form-actions .button-dark:hover { background-image: linear-gradient(135deg, #07111b, #0f4a45, #0bbf8a); background-position: 100% 0; }

@media (prefers-reduced-motion: no-preference) {
  @keyframes xnd-blob-a { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(60px, 50px) scale(1.18); } }
  @keyframes xnd-blob-b { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-70px, -40px) scale(1.12); } }
  @keyframes xnd-glint { 0% { transform: skewX(-18deg) translateX(0); opacity: 0; } 15% { opacity: 1; } 100% { transform: skewX(-18deg) translateX(520%); opacity: 0; } }
  @keyframes xnd-sheen-text { to { background-position: 300% 0; } }
  @keyframes xnd-copy-in { from { opacity: 0; transform: translateY(30px); filter: blur(8px); } to { opacity: 1; transform: none; filter: blur(0); } }
  @keyframes xnd-core-pulse { 0%, 100% { filter: drop-shadow(0 0 30px rgba(224, 37, 37, .34)) drop-shadow(0 0 80px rgba(98, 246, 199, .1)); } 50% { filter: drop-shadow(0 0 52px rgba(224, 37, 37, .6)) drop-shadow(0 0 120px rgba(98, 246, 199, .26)); } }

  .identity-auth-shell .login-panel::before { animation: xnd-blob-a 14s ease-in-out infinite; }
  .identity-auth-shell .login-panel::after { animation: xnd-blob-b 17s ease-in-out infinite; }
  .identity-auth-shell .login-card::after { animation: xnd-glint 2.2s ease-out .9s 1 both; }
  .identity-auth-scene .login-copy { animation: xnd-copy-in 1s var(--ease) .1s both; }
  .auth-orbit span { animation: xnd-core-pulse 4.5s ease-in-out infinite; }
  .identity-auth-scene h1 {
    background: linear-gradient(90deg, #f4fffb 0%, #b6ffe6 35%, #cfe6ff 65%, #f4fffb 100%);
    background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
    animation: xnd-sheen-text 12s linear infinite;
  }
}