/* ============================================================
   Portfolio light theme — server patch 2026-11-27
   Injected by nginx (sub_filter) on every HTML page.
   Works by redefining the Tailwind v4 theme variables that the
   compiled CSS references (var(--color-*)), plus a few targeted
   structural overrides. Dark mode stays the untouched default;
   light mode activates via html[data-theme="light"].
   ============================================================ */

html[data-theme="light"] {
  /* --- Next.js site (Tailwind v4 theme vars) --- */
  --color-garden-950: #f2f7f4;  /* page bg  (was #060c08) */
  --color-garden-500: #0c8f62;  /* primary accent (was #10b981) */
  --color-garden-300: #097550;  /* hover links (was #6ee7b7) */
  --color-garden-50:  #0a3d28;  /* hero headings (was #ecfdf5) */
  --color-cyber-500:  #0b7089;  /* (was #06b6d4) */
  --color-vine-500:   #9333ea;  /* (was #a855f7) */
  --color-slate-200:  #22303f;  /* body text (was #e2e8f0) */
  --color-slate-300:  #3d5163;  /* secondary text */
  --color-slate-400:  #56697c;  /* muted text */
  --color-slate-500:  #4e6273;  /* faint text */
  --color-slate-600:  #64798c;  /* placeholders */
  --color-amber-500:  #b45309;  /* terminal highlights */
  --color-red-400:    #dc2626;
  --color-red-500:    #dc2626;  /* terminal dot */

  /* --- /resume/ page (Django template has its own vars) --- */
  --bg:          #f2f7f4;
  --panel:       rgba(12, 143, 98, .06);
  --border:      rgba(12, 143, 98, .28);
  --accent:      #0c8f62;
  --accent-soft: #0a7050;
  --text:        #22303f;
  --muted:       #56697c;
}

/* CTA buttons keep dark text on the bright green->cyan gradient */
html[data-theme="light"] .text-garden-950 { color: #03130c; }

/* custom cursor ball: difference-blend turns ugly on white —
   switch to a soft emerald glow */
html[data-theme="light"] .mix-blend-difference {
  mix-blend-mode: normal;
  background: #10b981;
  opacity: .3;
}

/* matrix-rain canvas: bright glyphs that sparkle on dark turn into
   noise on white — keep only a faint, darker ink texture */
html[data-theme="light"] canvas.opacity-70 {
  opacity: .13;
  filter: brightness(.72) saturate(.8);
}

html[data-theme="light"] ::selection { background: rgba(12, 143, 98, .22); }

/* ------------------------------------------------------------
   Floating theme toggle button (created by the injected script)
   Base styles = dark look; light overrides below.
   ------------------------------------------------------------ */
#theme-toggle {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 2147483000;
  width: 46px;
  height: 46px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(16, 185, 129, .3);
  background: rgba(6, 12, 8, .72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #6ee7b7;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .35);
  transition: transform .2s ease, background-color .3s ease,
              color .3s ease, border-color .3s ease, box-shadow .3s ease;
}
#theme-toggle:hover  { transform: scale(1.08); }
#theme-toggle:active { transform: scale(.95); }
#theme-toggle svg    { width: 22px; height: 22px; }
#theme-toggle .ic-sun { display: none; }

html[data-theme="light"] #theme-toggle {
  background: rgba(255, 255, 255, .92);
  border-color: rgba(12, 143, 98, .35);
  color: #b45309;
  box-shadow: 0 6px 24px rgba(12, 143, 98, .18);
}
html[data-theme="light"] #theme-toggle .ic-sun  { display: block; }
html[data-theme="light"] #theme-toggle .ic-moon { display: none; }

@media (prefers-reduced-motion: reduce) {
  #theme-toggle { transition: none; }
  html.theme-switching, html.theme-switching * { transition: none !important; }
}

/* short color transition while switching themes */
html.theme-switching,
html.theme-switching *,
html.theme-switching *::before,
html.theme-switching *::after {
  transition: background-color .3s ease, color .3s ease,
              border-color .3s ease, fill .3s ease, stroke .3s ease,
              box-shadow .3s ease, opacity .3s ease !important;
}

/* ------------------------------------------------------------
   v4 — creative back button ("cd .." pill, bottom-left)
   Created by boot.js v4 on every page. Collapsed = a 46px glass
   circle with a Font Awesome arrow; hover/focus expands it into
   the terminal command `cd ..`. Mirrors #theme-toggle (which
   lives bottom-right) so the pair reads as one control set.
   ------------------------------------------------------------ */
#back-btn {
  position: fixed;
  left: 1.25rem;
  bottom: 1.25rem;
  z-index: 2147483000;
  max-width: 46px;
  height: 46px;
  padding: 0 15px;
  display: none; /* boot.js reveals it once there is a trail */
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(16, 185, 129, .3);
  background: rgba(6, 12, 8, .72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #6ee7b7;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  letter-spacing: .03em;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .35);
  transition: transform .2s ease, background-color .3s ease,
              border-color .3s ease, box-shadow .3s ease,
              max-width .28s ease;
  animation: backbtn-in .5s ease 1s backwards;
}
#back-btn .fa-arrow-left { font-size: 15px; transition: transform .25s ease; }
#back-btn .cd-label {
  display: inline-block;
  max-width: 0;
  margin-left: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-width .28s ease, opacity .22s ease, margin-left .28s ease;
}
#back-btn:hover,
#back-btn:focus-visible {
  max-width: 150px;
  background: rgba(16, 185, 129, .14);
  border-color: rgba(16, 185, 129, .55);
  outline: none;
}
#back-btn:hover .cd-label,
#back-btn:focus-visible .cd-label {
  max-width: 96px;
  margin-left: 8px;
  opacity: 1;
}
#back-btn:hover .fa-arrow-left { transform: translateX(-2px); }
#back-btn:active { transform: scale(.94); }
@keyframes backbtn-in {
  from { opacity: 0; transform: translateX(-16px); }
  to   { opacity: 1; transform: none; }
}
html[data-theme="light"] #back-btn {
  background: rgba(255, 255, 255, .92);
  border-color: rgba(12, 143, 98, .35);
  color: #b45309;
  box-shadow: 0 6px 24px rgba(12, 143, 98, .18);
}
html[data-theme="light"] #back-btn:hover,
html[data-theme="light"] #back-btn:focus-visible {
  background: rgba(12, 143, 98, .08);
}
@media (max-width: 640px) {
  #back-btn { left: 1rem; bottom: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  #back-btn { transition: none; animation: none; }
}

/* ------------------------------------------------------------
   v4 — dark-mode text readability
   The compiled Tailwind utilities reference the same theme vars
   the light theme redefines, so lifting the slate ramp in the
   DARK scope (the default: html without data-theme) raises
   contrast for every muted text tier while preserving the
   visual hierarchy between them.
   ------------------------------------------------------------ */
html:not([data-theme="light"]) {
  --color-slate-300: #d5dde7;  /* body/secondary text (was #cbd5e1) */
  --color-slate-400: #b2c0d2;  /* muted text (was #94a3b8) */
  --color-slate-500: #93a6bd;  /* faint text (was #64748b) */
  --color-slate-600: #8196b0;  /* bylines/placeholders (was #475569) */
  --color-slate-700: #63798f;  /* subtle borders (was #334155) */
  /* /resume/ page vars (its dark defaults live in the template) */
  --muted: #a5b6ca;
}

/* ------------------------------------------------------------
   v5 — privacy: no personal-info forms anywhere on the site
   CSS hides every <form> at first paint (hydration-safe: the
   rule lives outside React's diffing). boot.js v5 swaps the
   area for a .privacy-note and removes the node after
   hydration. The Django admin does NOT load this stylesheet.
   ------------------------------------------------------------ */
form { display: none !important; }

.privacy-note {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.7;
  color: #93a6bd;
  border: 1px dashed rgba(16, 185, 129, .35);
  border-radius: 12px;
  background: rgba(16, 185, 129, .04);
  padding: 14px 18px;
  margin: 12px 0;
}
html[data-theme="light"] .privacy-note {
  color: #4e6273;
  border-color: rgba(12, 143, 98, .4);
  background: rgba(12, 143, 98, .05);
}
