/* Agent Day — skins and themes of the NovaChem portal (portal/app/skins.css): enterprise (default) and Charger AI, light and dark. */
@font-face {
  font-family: Manrope;
  src: url('fonts/manrope.woff2') format('woff2');
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: 'Google Sans';
  src: url('fonts/google-sans-flex.woff2') format('woff2');
  font-weight: 500 700;
  font-display: swap;
}

/* eLearning enterprise: Midnight Executive tokens. */
html {
  --skin-bg-light: #f5f6f8;
  --skin-surface-light: #ffffff;
  --skin-surface2-light: #eef1f5;
  --skin-text-light: #0b1220;
  --skin-muted-light: #5a6680;
  --skin-border-light: #cdd3dd;
  --skin-accent-light: #2856d9;
  --skin-on-accent-light: #ffffff;
  --skin-bg-dark: #070b16;
  --skin-surface-dark: #0f1a2e;
  --skin-surface2-dark: #15223a;
  --skin-text-dark: #e6ecf8;
  --skin-muted-dark: #9aa9c7;
  --skin-border-dark: #2a3d61;
  --skin-accent-dark: #91acff;
  --skin-on-accent-dark: #070b16;
  --cta: linear-gradient(135deg, #3366ff, #5b4df5 52%, #8b3df0);
  --cta-text: #ffffff;
  --radius: 14px;
  --topbar-h: 80px;
  --gap: 20px;
}
/* Charger: palette from charger-ai.com. */
html[data-skin='charger'] {
  --skin-bg-light: #fafafa;
  --skin-surface-light: #ffffff;
  --skin-surface2-light: #f3f4f6;
  --skin-text-light: #111827;
  --skin-muted-light: #4b5563;
  --skin-border-light: #d1d5db;
  --skin-accent-light: #1a365d;
  --skin-on-accent-light: #ffffff;
  --skin-bg-dark: #05070d;
  --skin-surface-dark: #0b0e14;
  --skin-surface2-dark: #131722;
  --skin-text-dark: #eef1f6;
  --skin-muted-dark: #b4bdca;
  --skin-border-dark: #2b3342;
  --skin-accent-dark: #7aa7ff;
  --skin-on-accent-dark: #0b0e14;
  --cta: var(--accent);
  --cta-text: var(--accent-contrast);
  --radius: 8px;
}

html {
  color-scheme: light;
  --bg: var(--skin-bg-light);
  --surface: var(--skin-surface-light);
  --surface-2: var(--skin-surface2-light);
  --text: var(--skin-text-light);
  --muted: var(--skin-muted-light);
  --border: var(--skin-border-light);
  --accent: var(--skin-accent-light);
  --accent-contrast: var(--skin-on-accent-light);
  --shadow: rgb(15 23 42 / .18);
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme='light']) {
    color-scheme: dark;
    --bg: var(--skin-bg-dark);
    --surface: var(--skin-surface-dark);
    --surface-2: var(--skin-surface2-dark);
    --text: var(--skin-text-dark);
    --muted: var(--skin-muted-dark);
    --border: var(--skin-border-dark);
    --accent: var(--skin-accent-dark);
    --accent-contrast: var(--skin-on-accent-dark);
    --shadow: rgb(0 0 0 / .8);
  }
}
html[data-theme='dark'] {
  color-scheme: dark;
  --bg: var(--skin-bg-dark);
  --surface: var(--skin-surface-dark);
  --surface-2: var(--skin-surface2-dark);
  --text: var(--skin-text-dark);
  --muted: var(--skin-muted-dark);
  --border: var(--skin-border-dark);
  --accent: var(--skin-accent-dark);
  --accent-contrast: var(--skin-on-accent-dark);
  --shadow: rgb(0 0 0 / .8);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100dvh;
  position: relative;
  isolation: isolate;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.5 Manrope, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
/* Enterprise: one continuous eLearning aurora behind the navigation and tiles, in both themes. */
html:not([data-skin='charger']) body::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0 0 auto;
  height: 720px;
  pointer-events: none;
  background:
    radial-gradient(rgb(255 255 255 / .10) 1px, transparent 1px) 0 0 / 26px 26px,
    radial-gradient(40% 70% at 12% 10%, rgb(51 102 255 / .55), transparent 65%),
    radial-gradient(35% 60% at 88% 0%, rgb(139 61 240 / .5), transparent 65%),
    radial-gradient(30% 50% at 55% 80%, rgb(34 211 238 / .18), transparent 70%),
    linear-gradient(180deg, #050816, #0a1230 60%, #0b1430);
  mask-image: linear-gradient(180deg, #000 0%, #000 66%, transparent 100%);
}
/* Charger: flat page with a soft accent glow. */
html[data-skin='charger'] body {
  background: radial-gradient(ellipse at 80% 0, color-mix(in srgb, var(--accent) 10%, transparent), transparent 65%) no-repeat, var(--bg);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  min-height: var(--topbar-h);
  padding: 12px 24px;
  color: #f2f5fc;
  background: rgb(7 11 26 / .82);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgb(226 232 245 / .16);
  box-shadow: 0 10px 30px -14px rgb(5 8 22 / .35);
}
html[data-skin='charger'] .topbar {
  color: var(--text);
  background: color-mix(in srgb, var(--bg) 95%, transparent);
  backdrop-filter: blur(24px);
  border-bottom-color: var(--border);
  box-shadow: none;
}

.charger-logo {
  --logo-ink: #eef1f6;
  --logo-accent: #7aa7ff;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  color: var(--logo-ink);
  text-decoration: none;
  font: 700 1.25rem Manrope, system-ui, sans-serif;
  letter-spacing: -.04em;
  border-radius: 8px;
}
.charger-logo-mark { display: grid; width: 44px; height: 44px; }
.charger-logo-mark img { grid-area: 1 / 1; width: 44px; height: 44px; object-fit: contain; }
.charger-logo-light { display: none; }
.charger-logo-accent { color: var(--logo-accent); }
/* The enterprise topbar stays dark; Charger's follows the theme. */
html[data-skin='charger'] .charger-logo { --logo-ink: #111827; --logo-accent: #1a365d; }
html[data-skin='charger'] .charger-logo-light { display: block; }
html[data-skin='charger'] .charger-logo-dark { display: none; }
@media (prefers-color-scheme: dark) {
  html[data-skin='charger']:not([data-theme='light']) .charger-logo { --logo-ink: #eef1f6; --logo-accent: #7aa7ff; }
  html[data-skin='charger']:not([data-theme='light']) .charger-logo-light { display: none; }
  html[data-skin='charger']:not([data-theme='light']) .charger-logo-dark { display: block; }
}
html[data-skin='charger'][data-theme='dark'] .charger-logo { --logo-ink: #eef1f6; --logo-accent: #7aa7ff; }
html[data-skin='charger'][data-theme='dark'] .charger-logo-light { display: none; }
html[data-skin='charger'][data-theme='dark'] .charger-logo-dark { display: block; }

.event-title {
  margin: 0;
  font: 600 1.6rem/1.2 'Google Sans', Manrope, sans-serif;
  letter-spacing: .025em;
  text-transform: uppercase;
  text-align: center;
  text-wrap: balance;
}
.event-title::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 1em;
  margin-right: 12px;
  border-radius: 4px;
  background: #91acff;
  vertical-align: -.1em;
}
html[data-skin='charger'] .event-title::before { background: var(--accent); }
.event-meta { margin-left: .5em; font-weight: 500; opacity: .8; }

/* Appearance settings: the portal's gear button and popover. */
.appearance { justify-self: end; }
.theme-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: inherit;
  background: rgb(255 255 255 / .08);
  border: 1px solid rgb(255 255 255 / .24);
  border-radius: 8px;
  cursor: pointer;
}
.theme-button:hover { background: rgb(255 255 255 / .16); }
html[data-skin='charger'] .theme-button { border-radius: 999px; background: var(--surface); border-color: var(--border); }
html[data-skin='charger'] .theme-button:hover { background: var(--surface-2); }
.appearance-options {
  inset: auto;
  position-area: bottom span-left;
  position-try-fallbacks: flip-inline;
  width: 310px;
  max-width: calc(100vw - 16px);
  margin: 8px 0;
  padding: 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 18px 40px -16px var(--shadow);
}
.appearance-options:popover-open { display: flex; flex-direction: column; gap: 16px; }
.appearance-options fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.appearance-options legend { margin-bottom: 8px; color: var(--muted); font-size: .8rem; }
.choices { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.choices button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 6px 10px;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: 600 .85rem Manrope, system-ui, sans-serif;
  cursor: pointer;
}
.choices button:hover { background: var(--surface-2); }
.choices button[aria-pressed='true'] { color: var(--accent); border-color: var(--accent); background: var(--surface-2); }
.choices svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.skin-swatch { width: 24px; height: 18px; border: 1px solid #8490a4; border-radius: 4px; }
.skin-swatch-enterprise { background: linear-gradient(135deg, #3366ff, #8b3df0); }
.skin-swatch-charger { background: linear-gradient(90deg, #0b0e14 65%, #7aa7ff 65%); }

.tiles {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
  height: calc(100dvh - var(--topbar-h));
  min-height: 600px;
  padding: var(--gap) 24px 24px;
}

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 18px 40px -24px var(--shadow);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.tile:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 24px 50px -24px color-mix(in srgb, var(--accent) 60%, transparent);
}
.tile:focus-visible, .charger-logo:focus-visible, .theme-button:focus-visible, .choices button:focus-visible { outline: 3px solid #a9c1ff; outline-offset: 3px; }
html[data-skin='charger'] :is(.tile, .charger-logo, .theme-button, .choices button):focus-visible { outline-color: var(--accent); }
.tile-shot {
  flex: 1;
  min-height: 0;
  width: 100%;
  height: auto;
  object-fit: cover;
  object-position: top left;
  border-bottom: 1px solid var(--border);
}
.tile-body { padding: 16px 20px 18px; }
.tile h2 {
  margin: 0 0 4px;
  font: 600 1.45rem/1.2 'Google Sans', Manrope, sans-serif;
  letter-spacing: .02em;
}
.tile p { margin: 0; color: var(--muted); font-size: .92rem; }

/* The game: the largest tile, its screenshot faded into the tile behind the text. */
.tile-game { grid-row: 1 / 3; justify-content: flex-end; }
.tile-game .tile-shot {
  position: absolute;
  inset: 0;
  height: 100%;
  border: 0;
  opacity: .6;
}
.tile-game::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 50% at 20% 100%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 70%),
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 10%, transparent) 0%, color-mix(in srgb, var(--surface) 60%, transparent) 45%, var(--surface) 100%);
}
.tile-game .tile-body { position: relative; z-index: 1; padding: 32px; }
.tile-game h2 {
  margin-bottom: 12px;
  font-size: clamp(2.2rem, 3.6vw, 3.6rem);
  line-height: 1.05;
  text-transform: uppercase;
  letter-spacing: .025em;
}
.tile-game p { max-width: 46ch; color: var(--text); opacity: .85; font-size: 1.05rem; }
.tile-badge {
  display: inline-block;
  margin-bottom: 14px;
  padding: 4px 12px;
  border: 1px solid color-mix(in srgb, currentColor 24%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, currentColor 8%, transparent);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.tile-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  margin-top: 22px;
  padding: 10px 26px;
  border-radius: 10px;
  background: var(--cta);
  color: var(--cta-text);
  font-weight: 700;
  font-size: 1.05rem;
}
html[data-skin='charger'] .tile-cta { border-radius: 6px; }
.tile-cta span { transition: transform .2s ease; }
.tile-game:hover .tile-cta span { transform: translateX(3px); }

/* Tablets and short screens: game on top, apps in two columns, page scrolls. */
@media (max-width: 1100px), (max-height: 640px) {
  .tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
    height: auto;
    min-height: 0;
  }
  .tile-game { grid-row: auto; grid-column: 1 / -1; min-height: 420px; }
  .tile-shot { flex: none; aspect-ratio: 16 / 10; }
  .tile-game .tile-shot { aspect-ratio: auto; }
}

@media (max-width: 640px) {
  html { --topbar-h: 64px; --gap: 16px; }
  .topbar { grid-template-columns: auto 1fr auto; gap: 12px; padding: 10px 16px; }
  .charger-logo { font-size: 1.05rem; }
  .charger-logo-mark, .charger-logo-mark img { width: 36px; height: 36px; }
  .event-title { font-size: 1.05rem; text-align: right; }
  .event-title::before { display: none; }
  .event-meta { display: block; margin: 0; font-size: .75rem; }
  .tiles { grid-template-columns: minmax(0, 1fr); padding: var(--gap) 16px 24px; }
  .tile-game { min-height: 460px; }
  .tile-game .tile-body { padding: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .tile, .tile-cta span { transition: none; }
  .tile:hover { transform: none; }
}
