/* ELUX investor login and portal (loaded after styles.css) */

body.portal-page {
  background:
    radial-gradient(ellipse 70% 50% at 70% 0%, rgba(11, 85, 168, .16), transparent 70%),
    var(--bg);
  min-height: 100vh;
}
/* The login page sits over the live circuit board (circuit.js), so the body stays transparent */
body.login-page { background: transparent; min-height: 100vh; }
body.login-page::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse 55% 45% at 50% 50%, rgba(11, 85, 168, .14), transparent 70%);
}
.portal-page .site-header, .login-page .site-header { position: sticky; }
.header-inner .nav-link { font-size: 13px; }

/* Login */
.login-main { min-height: calc(100vh - 72px); min-height: calc(100svh - 72px); display: grid; place-items: center; padding: 48px var(--gutter); }
.login-card {
  width: 100%; max-width: 440px; padding: clamp(28px, 5vw, 44px);
  background: rgba(20, 23, 28, .78); border: 1px solid var(--line); border-radius: var(--radius);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 40px 120px rgba(0, 0, 0, .55), 0 0 0 1px rgba(62, 143, 224, .06);
  position: relative; overflow: hidden;
  animation: card-in 1s var(--ease) both;
  transition: border-color .4s, box-shadow .6s;
}
@keyframes card-in { from { opacity: 0; transform: translateY(24px) scale(.98); } to { opacity: 1; transform: none; } }
.login-card > :not(.login-sweep) { animation: rise-in .9s var(--ease) both; }
.login-card > :nth-child(2) { animation-delay: .15s; }
.login-card > :nth-child(3) { animation-delay: .25s; }
.login-card > :nth-child(4) { animation-delay: .32s; }
.login-card > :nth-child(5) { animation-delay: .39s; }
.login-card > :nth-child(6) { animation-delay: .46s; }
.login-card > :nth-child(7) { animation-delay: .53s; }
@keyframes rise-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* A light that runs along the top edge, like the brand light bar */
.login-sweep { position: absolute; left: 0; right: 0; top: 0; height: 2px; overflow: hidden; background: rgba(62, 143, 224, .15); }
.login-sweep::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -40%;
  background: linear-gradient(90deg, transparent, #fff 45%, var(--accent-light) 60%, transparent);
  box-shadow: 0 0 14px var(--accent-light);
  animation: sweep 3.6s ease-in-out 1s infinite;
}
@keyframes sweep { 0% { left: -40%; } 60%, 100% { left: 100%; } }

/* Lock that opens on a successful sign-in */
.login-lock { width: 52px; height: 52px; display: grid; place-items: center; margin-bottom: 20px;
  border: 1px solid var(--line); border-radius: 50%; background: rgba(10, 11, 13, .6);
  box-shadow: inset 0 0 0 4px rgba(10, 11, 13, .6), 0 0 0 0 rgba(62, 143, 224, 0); transition: box-shadow .6s, border-color .4s; }
.login-lock svg { width: 26px; height: 26px; fill: none; stroke: #C9CED5; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.lock-key { fill: #C9CED5; stroke: none; }
.lock-shackle { transform-origin: 32px 22px; transition: transform .5s var(--ease); }
.login-card.typing .login-lock { border-color: rgba(62, 143, 224, .45); }
.login-card.typing .lock-key { fill: var(--accent-light); }
.login-card.unlocked { border-color: rgba(62, 143, 224, .6); box-shadow: 0 40px 120px rgba(0, 0, 0, .55), 0 0 80px rgba(11, 85, 168, .35); }
.login-card.unlocked .login-lock { border-color: var(--accent-light); box-shadow: inset 0 0 0 4px rgba(10, 11, 13, .6), 0 0 32px rgba(62, 143, 224, .6); }
.login-card.unlocked .login-lock svg { stroke: #fff; }
.login-card.unlocked .lock-shackle { transform: translateY(-5px) rotate(28deg); }
.login-card.unlocked .lock-key { fill: #fff; }
.login-card.ready { animation: none; }
.login-card.denied, .login-card.ready.denied { animation: shake .45s cubic-bezier(.36, .07, .19, .97); border-color: rgba(255, 138, 142, .45); }
@keyframes shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-7px); } 40%, 60% { transform: translateX(7px); } }

.login-card h1 { font-size: clamp(30px, 4vw, 40px); margin-top: 8px; }
.login-lead { color: var(--muted); margin-top: 12px; }
.login-form { display: grid; gap: 18px; margin-top: 28px; }
.login-help { color: var(--muted); font-size: 14px; margin-top: 24px; text-align: center; }

/* Password field with show / hide */
.pw-wrap { position: relative; }
.pw-wrap input { width: 100%; padding-right: 48px; transition: border-color .25s, box-shadow .3s; }
.pw-wrap input:focus { box-shadow: 0 0 0 3px rgba(62, 143, 224, .18), 0 0 24px rgba(62, 143, 224, .15); }
.pw-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; display: grid; place-items: center;
  background: none; border: 0; border-radius: var(--radius); color: var(--muted); cursor: pointer;
}
.pw-toggle:hover { color: #fff; }
.pw-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pw-toggle .pw-slash { opacity: 1; transition: opacity .2s; }
.pw-toggle[aria-pressed="true"] .pw-slash { opacity: 0; }
.btn-unlocked { background: var(--accent-light) !important; border-color: var(--accent-light) !important; box-shadow: 0 0 40px rgba(62, 143, 224, .5) !important; }

@media (prefers-reduced-motion: reduce) {
  .login-card, .login-card > *, .login-sweep::after { animation: none !important; }
}

/* Portal intro */
.portal-intro { padding-top: clamp(48px, 8vw, 96px); padding-bottom: 32px; }
.portal-intro h1 { font-size: clamp(34px, 5vw, 60px); margin-top: 12px; }
.portal-lead { color: var(--muted); max-width: 62ch; margin-top: 16px; font-size: 17px; }

/* Deck viewer */
.deck { padding-bottom: 24px; scroll-margin-top: 88px; }
.deck-stage {
  background: #000; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 40px 120px rgba(0, 0, 0, .5);
  position: relative;
  /* Keep the whole slide and its controls on screen */
  max-width: max(320px, calc((100vh - 72px - 96px) * 16 / 9)); margin: 0 auto;
}
.deck-frame { position: relative; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
.deck-frame img { width: 100%; height: 100%; object-fit: contain; }
.deck-frame.swap-next img { animation: deck-in-next .45s var(--ease); }
.deck-frame.swap-prev img { animation: deck-in-prev .45s var(--ease); }
@keyframes deck-in-next { from { opacity: .2; transform: translateX(2.5%); } to { opacity: 1; transform: none; } }
@keyframes deck-in-prev { from { opacity: .2; transform: translateX(-2.5%); } to { opacity: 1; transform: none; } }
.deck-hit { position: absolute; top: 0; bottom: 0; width: 30%; background: none; border: 0; padding: 0; cursor: pointer; }
.deck-hit-prev { left: 0; cursor: w-resize; }
.deck-hit-next { right: 0; cursor: e-resize; }

.deck-bar {
  display: flex; align-items: center; gap: 6px; padding: 8px 10px;
  background: var(--panel); border-top: 1px solid var(--line);
}
.deck-btn {
  flex: none; width: 40px; height: 40px; display: grid; place-items: center;
  background: transparent; border: 1px solid transparent; border-radius: var(--radius);
  color: var(--text); cursor: pointer; transition: background .2s, border-color .2s, color .2s;
}
.deck-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.deck-btn:hover:not(:disabled) { background: rgba(255, 255, 255, .06); border-color: var(--line); }
.deck-btn:disabled { color: #4A525C; cursor: default; }
.deck-btn[aria-pressed="true"] { color: var(--accent-light); border-color: rgba(62, 143, 224, .4); background: rgba(11, 85, 168, .14); }
.deck-count { font-family: var(--font-head); font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: .06em; min-width: 64px; text-align: center; }
.deck-of { color: var(--muted); }
.deck-title {
  flex: 1; min-width: 0; margin-left: 8px; color: var(--muted); font-size: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.deck-progress { height: 2px; background: var(--line); }
.deck-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-light)); box-shadow: 0 0 12px var(--accent-light); transition: width .4s var(--ease); }

/* Full screen */
.deck-stage:fullscreen { display: flex; flex-direction: column; border: 0; border-radius: 0; }
.deck-stage:fullscreen .deck-frame { flex: 1; aspect-ratio: auto; }
.deck-stage:-webkit-full-screen { display: flex; flex-direction: column; width: 100%; height: 100%; }
.deck-stage:-webkit-full-screen .deck-frame { flex: 1; aspect-ratio: auto; }
.deck-stage.pseudo-fs { position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; border-radius: 0; }
.deck-stage.pseudo-fs .deck-frame { flex: 1; aspect-ratio: auto; }

/* Slide text */
.deck-text {
  margin-top: 16px; padding: 24px clamp(20px, 3vw, 32px);
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
.deck-text .kicker:empty { display: none; }
.deck-text h2 { font-size: clamp(22px, 2.6vw, 30px); margin-top: 8px; }
.deck-text ul { margin-top: 16px; display: grid; gap: 8px; columns: 2 280px; column-gap: 40px; display: block; }
.deck-text li { color: #C9CED5; padding-left: 16px; position: relative; break-inside: avoid; margin-bottom: 8px; }
.deck-text li::before { content: ""; position: absolute; left: 0; top: .7em; width: 6px; height: 1px; background: var(--accent-light); }

/* Thumbnails */
.deck-strip {
  display: flex; gap: 10px; overflow-x: auto; padding: 16px 2px 12px; margin-top: 4px;
  scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.deck-strip li { flex: none; width: clamp(120px, 14vw, 168px); scroll-snap-align: center; }
.deck-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 44vw), 1fr)); gap: 16px; margin-top: 16px; }
.deck-thumb {
  display: block; width: 100%; padding: 0; position: relative; text-align: left;
  background: #000; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  color: var(--text); cursor: pointer; opacity: .62; transition: opacity .2s, border-color .2s, transform .2s;
}
.deck-thumb img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.deck-thumb:hover { opacity: 1; transform: translateY(-2px); }
.deck-thumb.active { opacity: 1; border-color: var(--accent-light); box-shadow: 0 0 0 1px var(--accent-light), 0 0 24px rgba(62, 143, 224, .3); }
.deck-thumb-num {
  position: absolute; left: 6px; top: 6px; font-family: var(--font-head); font-size: 11px; font-weight: 600;
  background: rgba(10, 11, 13, .8); padding: 1px 6px; border-radius: 2px; letter-spacing: .06em;
}
.deck-thumb-cap { display: block; padding: 8px 10px 10px; font-size: 13px; color: var(--muted); background: var(--panel); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deck-grid .deck-thumb { opacity: .85; }
.deck-keys { color: #6B727C; font-size: 12px; text-align: center; margin-top: 4px; }
.deck-keys kbd {
  font-family: var(--font-body); font-size: 11px; border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 3px; padding: 0 5px; margin: 0 2px; color: var(--muted);
}
@media (hover: none) { .hide-touch { display: none; } }
@media (max-width: 560px) {
  .deck-title { display: none; }
  .deck-count { flex: 1; }
}

/* Downloads */
.downloads { padding: clamp(56px, 8vw, 96px) var(--gutter); }
.dl-tile {
  display: grid; gap: 28px; padding: clamp(24px, 4vw, 40px);
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  position: relative; overflow: hidden;
}
.dl-tile::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--accent-light), transparent); }
@media (min-width: 860px) { .dl-tile { grid-template-columns: 1fr auto; align-items: center; gap: 48px; } }
.dl-type {
  display: inline-block; font-family: var(--font-head); font-weight: 700; font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent-light); border: 1px solid rgba(62, 143, 224, .45); border-radius: 2px; padding: 2px 8px;
}
.dl-name { font-family: var(--font-head); font-size: clamp(22px, 2.6vw, 28px); font-weight: 600; margin-top: 14px; }
.dl-desc { color: var(--muted); margin-top: 10px; max-width: 56ch; }
.dl-actions { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
@media (min-width: 860px) { .dl-actions { grid-template-columns: repeat(2, 168px); } }
.dl-btn {
  display: grid; gap: 4px; padding: 16px 18px; text-decoration: none; color: var(--text);
  background: rgba(10, 11, 13, .6); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .25s, transform .25s var(--ease), box-shadow .25s;
}
.dl-btn:hover { color: var(--text); border-color: rgba(62, 143, 224, .6); transform: translateY(-2px); box-shadow: 0 16px 40px rgba(0, 0, 0, .4), 0 0 32px rgba(11, 85, 168, .2); }
.dl-fmt { font-family: var(--font-head); font-weight: 700; font-size: 20px; letter-spacing: .06em; }
.dl-size { color: #6B727C; font-size: 13px; font-variant-numeric: tabular-nums; }
.dl-go {
  margin-top: 8px; font-family: var(--font-head); font-weight: 600; font-size: 12px;
  letter-spacing: .12em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 8px;
}
.dl-go::after {
  content: ""; width: 13px; height: 13px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4v12M6 11l6 6 6-6M5 20h14'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4v12M6 11l6 6 6-6M5 20h14'/%3E%3C/svg%3E") center / contain no-repeat;
}
.dl-btn:hover .dl-go { color: var(--accent-light); }

@media (prefers-reduced-motion: reduce) {
  .deck-frame.swap-next img, .deck-frame.swap-prev img { animation: none; }
  .dl-btn, .deck-thumb { transition: none; }
}

/* Legal links under the login card */
.legal-mini { display: flex; justify-content: center; padding: 0 var(--gutter) 32px; margin-top: -24px; }
