/* ==========================================================================
   Light and dark. The dark colours of every page come from dark.css, made
   by tools/make_dark_css.py from the light stylesheets; this file is the
   switch itself, the circle it opens with, and what the generator cannot
   know (pictures, a few hand-tuned surfaces).
   ========================================================================== */

/* ---- the switch: a pill with a knob that carries a sun or a moon ---- */
.theme-toggle { display: inline-flex; align-items: center; flex: none; padding: 0; border: 0; background: none;
  cursor: pointer; border-radius: 999px; -webkit-tap-highlight-color: transparent; }
.theme-toggle:focus-visible { outline: 2px solid #2563eb; outline-offset: 3px; }
.tt-track { position: relative; display: block; width: 46px; height: 26px; border-radius: 999px; background: #e4e7ec;
  border: 1px solid #d0d5dd; transition: background .35s ease, border-color .35s ease; }
.tt-knob { position: absolute; top: 2px; left: 2px; display: grid; place-items: center; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; color: #b45309; box-shadow: 0 1px 3px rgba(16, 24, 40, .25);
  transition: transform .35s cubic-bezier(.65, 0, .35, 1), background .35s ease, color .35s ease; }
.tt-knob svg { position: absolute; width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.2;
  stroke-linecap: round; stroke-linejoin: round; transition: opacity .25s ease, transform .35s ease; }
.tt-moon { opacity: 0; transform: rotate(-60deg) scale(.6); }
.theme-toggle[aria-pressed="true"] .tt-track { background: #111827; border-color: #374151; }
.theme-toggle[aria-pressed="true"] .tt-knob { transform: translateX(20px); background: #f8fafc; color: #1e3a8a; }
.theme-toggle[aria-pressed="true"] .tt-sun { opacity: 0; transform: rotate(60deg) scale(.6); }
.theme-toggle[aria-pressed="true"] .tt-moon { opacity: 1; transform: none; }
.theme-toggle:hover .tt-track { border-color: #98a2b3; }
@media (prefers-reduced-motion: reduce) { .tt-track, .tt-knob, .tt-knob svg { transition: none; } }

/* where it sits: the right end of the top bar, or floating on pages without one */
.erp-bar-end { display: inline-flex; align-items: center; gap: 10px; margin-left: auto; }
.erp-bar-mid + .erp-bar-end { margin-left: 0; }
.theme-float { position: fixed; top: 14px; right: 16px; z-index: 120; padding: 6px; border-radius: 999px;
  background: rgba(255, 255, 255, .85); box-shadow: 0 6px 18px -10px rgba(16, 24, 40, .45); backdrop-filter: blur(8px); }
html[data-theme="dark"] .theme-float { background: rgba(17, 22, 32, .85); }
@media print { .theme-toggle, .theme-float { display: none !important; } }

/* ---- the circle the new look opens out of ---- */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
.theme-turning * { transition: none !important; }

/* ---- what the generator cannot know ---- */
/* the university's own light logo, made for dark grounds (js/theme.js swaps it too) */
html[data-theme="dark"] img[src*="/img/jain-logo.png"] { content: url("../img/jain-logo-light.png"); }
html[data-theme="dark"] ::selection { background: #1e40af; color: #fff; }
html[data-theme="dark"] input, html[data-theme="dark"] select, html[data-theme="dark"] textarea { color-scheme: dark; }
html[data-theme="dark"] input::placeholder, html[data-theme="dark"] textarea::placeholder { color: #7d8799; }
/* a document shown as a page keeps its white paper */
html[data-theme="dark"] .gen-doc, html[data-theme="dark"] .share-doc .gen-doc { color-scheme: light; }

/* ---- a faint graph-paper grid behind every page (after Uiverse.io,
   kennyotsu-monochromia), kept light so it never competes with the content ---- */
:root { --page-grid: rgba(15, 36, 64, .045); }
html[data-theme="dark"] { --page-grid: rgba(255, 255, 255, .035); }
body, body.erp, body.has-side {
  background-image:
    linear-gradient(0deg, transparent 24%, var(--page-grid) 25%, var(--page-grid) 26%, transparent 27%, transparent 74%, var(--page-grid) 75%, var(--page-grid) 76%, transparent 77%, transparent),
    linear-gradient(90deg, transparent 24%, var(--page-grid) 25%, var(--page-grid) 26%, transparent 27%, transparent 74%, var(--page-grid) 75%, var(--page-grid) 76%, transparent 77%, transparent);
  background-size: 55px 55px;
  background-attachment: fixed;
}

/* dark.css paints the page after this file: the grid goes back on top of it */
html[data-theme="dark"]:root body {
  background-image:
    linear-gradient(0deg, transparent 24%, var(--page-grid) 25%, var(--page-grid) 26%, transparent 27%, transparent 74%, var(--page-grid) 75%, var(--page-grid) 76%, transparent 77%, transparent),
    linear-gradient(90deg, transparent 24%, var(--page-grid) 25%, var(--page-grid) 26%, transparent 27%, transparent 74%, var(--page-grid) 75%, var(--page-grid) 76%, transparent 77%, transparent);
  background-size: 55px 55px;
  background-attachment: fixed;
}

/* ---- a painted brush-stroke highlight for a key word or two (after a
   watercolour sticker): .hl, in peach, teal, yellow or green ---- */
.hl { display: inline-block; padding: .06em .45em .1em; margin: 0 -.05em; line-height: 1.15; color: #1f2937;
  background-repeat: no-repeat; background-position: center; background-size: 100% 100%; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.hl, .hl-peach { background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20200%2040'%20preserveAspectRatio='none'%3E%3Cpath%20fill='%23e9ad91'%20d='M5%209C40%204%2090%207%20128%205C158%204%20182%203%20196%207L191%2013L198%2019L190%2025L197%2031C160%2037%20112%2034%2072%2036C42%2037%2020%2036%206%2034L11%2028L2%2022L9%2016Z'/%3E%3Cpath%20fill='none'%20stroke='%23fff'%20stroke-opacity='.28'%20stroke-width='1.6'%20d='M14%2014C60%2011%20120%2012%20182%2011M20%2024C80%2022%20130%2024%20186%2023M30%2030C90%2029%20140%2031%20176%2029'/%3E%3C/svg%3E"); }
.hl-teal { background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20200%2040'%20preserveAspectRatio='none'%3E%3Cpath%20fill='%2393bcc2'%20d='M5%209C40%204%2090%207%20128%205C158%204%20182%203%20196%207L191%2013L198%2019L190%2025L197%2031C160%2037%20112%2034%2072%2036C42%2037%2020%2036%206%2034L11%2028L2%2022L9%2016Z'/%3E%3Cpath%20fill='none'%20stroke='%23fff'%20stroke-opacity='.28'%20stroke-width='1.6'%20d='M14%2014C60%2011%20120%2012%20182%2011M20%2024C80%2022%20130%2024%20186%2023M30%2030C90%2029%20140%2031%20176%2029'/%3E%3C/svg%3E"); }
.hl-yellow { background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20200%2040'%20preserveAspectRatio='none'%3E%3Cpath%20fill='%23f2cd73'%20d='M5%209C40%204%2090%207%20128%205C158%204%20182%203%20196%207L191%2013L198%2019L190%2025L197%2031C160%2037%20112%2034%2072%2036C42%2037%2020%2036%206%2034L11%2028L2%2022L9%2016Z'/%3E%3Cpath%20fill='none'%20stroke='%23fff'%20stroke-opacity='.28'%20stroke-width='1.6'%20d='M14%2014C60%2011%20120%2012%20182%2011M20%2024C80%2022%20130%2024%20186%2023M30%2030C90%2029%20140%2031%20176%2029'/%3E%3C/svg%3E"); }
.hl-green { background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20200%2040'%20preserveAspectRatio='none'%3E%3Cpath%20fill='%23a3d3aa'%20d='M5%209C40%204%2090%207%20128%205C158%204%20182%203%20196%207L191%2013L198%2019L190%2025L197%2031C160%2037%20112%2034%2072%2036C42%2037%2020%2036%206%2034L11%2028L2%2022L9%2016Z'/%3E%3Cpath%20fill='none'%20stroke='%23fff'%20stroke-opacity='.28'%20stroke-width='1.6'%20d='M14%2014C60%2011%20120%2012%20182%2011M20%2024C80%2022%20130%2024%20186%2023M30%2030C90%2029%20140%2031%20176%2029'/%3E%3C/svg%3E"); }
html[data-theme="dark"] .hl { color: #111827; }
/* a note saying something fills itself in: a yellow highlighter stroke
   under the words, line by line */
.hl-auto { padding: .05em .3em; margin: 0 -.1em; border-radius: 3px; color: #1f2937;
  background: linear-gradient(100deg, rgba(242, 205, 115, .2) 0%, rgba(242, 205, 115, .85) 4%,
              rgba(244, 214, 128, .75) 50%, rgba(242, 205, 115, .9) 96%, rgba(242, 205, 115, .25) 100%);
  -webkit-box-decoration-break: clone; box-decoration-break: clone; }
html[data-theme="dark"]:root .hl-auto { color: #111827; }

/* ---- the light / dark switch as two pictures: day (ON) and night (OFF) ---- */
.tt-pic { position: relative; display: block; width: 72px; height: 32px; }
.tt-pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
  transition: opacity .35s ease, transform .45s cubic-bezier(.65, 0, .35, 1); }
.tt-night { opacity: 0; transform: translateX(6px); }
.theme-toggle[aria-pressed="true"] .tt-day { opacity: 0; transform: translateX(-6px); }
.theme-toggle[aria-pressed="true"] .tt-night { opacity: 1; transform: none; }
.theme-toggle:hover .tt-pic img { filter: drop-shadow(0 2px 4px rgba(15, 36, 64, .25)); }
@media (prefers-reduced-motion: reduce) { .tt-pic img { transition: none; } }

/* The sign-in picture is a picture: in dark mode it keeps its navy scene and
   white cards, the same as in light mode, with a faint edge on the dark page. */
html[data-theme="dark"]:root .login-stage {
  background: radial-gradient(120% 90% at 70% 30%, #1d4ed8 0%, #0e2a5c 55%, #0b1f45 100%);
  box-shadow: 0 30px 60px -36px rgba(0, 0, 0, .8), inset 0 0 0 1px rgba(255, 255, 255, .06); }
html[data-theme="dark"]:root .login-stage::before { background-image: radial-gradient(rgba(255, 255, 255, .10) 1px, transparent 1px); }
html[data-theme="dark"]:root .lp { border-color: rgba(255, 255, 255, .35); }
html[data-theme="dark"]:root .lp-blue { background: linear-gradient(160deg, rgba(88, 112, 240, .92), rgba(47, 79, 216, .85)); }
html[data-theme="dark"]:root .lp-slate { background: linear-gradient(160deg, rgba(148, 163, 184, .88), rgba(71, 85, 105, .85)); }
html[data-theme="dark"]:root .lp-glass { background: linear-gradient(160deg, rgba(232, 237, 247, .86), rgba(160, 174, 198, .72)); }
html[data-theme="dark"]:root .lp-dot { background: #fff; }
html[data-theme="dark"]:root .lp-glass .lp-title { color: #0e2a5c; }
html[data-theme="dark"]:root .lp-card { background: rgba(255, 255, 255, .95); }
html[data-theme="dark"]:root .lp-card b { color: #0e2a5c; }
html[data-theme="dark"]:root .lp-card i { background: #c9d2e3; }
html[data-theme="dark"]:root .lp-tick { background: #e7ecf4; }
html[data-theme="dark"]:root .lp-card.is-done .lp-tick { background: #16a34a; color: #fff; }
html[data-theme="dark"]:root .lsc-steps i { background: rgba(255, 255, 255, .16); color: #fff; }
html[data-theme="dark"]:root .lsc-step.is-on i { background: #fff; color: #0e2a5c; }


/* The sign-in page's navy panel stays navy in dark mode (the generated dark
   rules would lift it to a bright blue, as they do navy buttons). */
html[data-theme="dark"] body.is-login .login-side {
  background: linear-gradient(160deg, #060c1a 0%, #0b1a33 55%, #142c4d 100%); color: #ffffff; }
html[data-theme="dark"] body.is-login .login-side h1 { color: #ffffff; }
html[data-theme="dark"] body.is-login .login-kicker { color: #9fb3d1; }
html[data-theme="dark"] body.is-login .login-lede { color: #c9d4e6; }
html[data-theme="dark"] body.is-login .login-steps li { color: #dbe4f2; border-color: rgba(255, 255, 255, .25); }
