/* ==========================================================================
   Daniel.tf — universal fallback theme
   For small, older or unstyled pages. Opt-in via <body class="u-theme">.
   Keeps the dark glass / aurora look of the main site without touching
   page-specific layout or scripts.
   ========================================================================== */

.u-theme {
  --u-bg: #05060c;
  --u-surface: rgba(255, 255, 255, 0.045);
  --u-border: rgba(255, 255, 255, 0.1);
  --u-border-strong: rgba(255, 255, 255, 0.2);
  --u-text: #f4f4fb;
  --u-text-soft: rgba(238, 238, 255, 0.72);
  --u-text-muted: rgba(226, 226, 245, 0.52);
  --u-violet: #9f91ff;
  --u-teal: #5eead4;
  --u-radius: 14px;
  --u-ease: cubic-bezier(0.22, 1, 0.36, 1);

  box-sizing: border-box;
  min-height: 100vh;
  margin: 0;
  padding: clamp(1.5rem, 5vw, 3.5rem) clamp(1rem, 4vw, 2.5rem);
  background-color: var(--u-bg);
  background-image:
    radial-gradient(52rem 40rem at 12% -10%, rgba(116, 96, 245, 0.34), transparent 70%),
    radial-gradient(40rem 34rem at 105% 110%, rgba(0, 190, 150, 0.2), transparent 70%),
    radial-gradient(34rem 30rem at 92% 4%, rgba(56, 132, 255, 0.16), transparent 72%);
  background-attachment: fixed;
  color: var(--u-text);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Normalise the root size so rem-based spacing stays predictable on
   legacy pages that scale their <html> font-size. */
html:has(.u-theme) {
  font-size: 16px;
  scroll-behavior: smooth;
}

.u-theme *,
.u-theme *::before,
.u-theme *::after {
  box-sizing: border-box;
}

.u-theme > *:not(main) {
  width: 100%;
  max-width: 56rem;
  margin-right: auto;
  margin-left: auto;
}

.u-theme main {
  margin-right: auto;
  margin-left: auto;
}

.u-theme h1,
.u-theme h2,
.u-theme h3,
.u-theme h4 {
  margin: 1.4em 0 0.5em;
  color: var(--u-text);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.025em;
}

.u-theme h1 {
  font-size: clamp(2rem, 6vw, 3rem);
  background: linear-gradient(180deg, #ffffff 12%, #ded9ff 55%, #a99cff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.u-theme h2 {
  font-size: clamp(1.35rem, 3.5vw, 1.8rem);
}

.u-theme h3 {
  font-size: 1.2rem;
}

.u-theme h1:first-child,
.u-theme h2:first-child,
.u-theme p:first-child {
  margin-top: 0;
}

.u-theme p {
  margin: 0 0 1rem;
  color: var(--u-text-soft);
}

.u-theme strong,
.u-theme b {
  color: var(--u-text);
  font-weight: 650;
}

.u-theme a {
  color: var(--u-violet);
  font-weight: 550;
  text-decoration: none;
  text-underline-offset: 3px;
}

.u-theme a:hover {
  color: #fff;
  text-decoration: underline;
}

.u-theme hr {
  height: 1px;
  margin: 2rem 0;
  border: 0;
  background: linear-gradient(90deg, transparent, var(--u-border-strong), transparent);
}

.u-theme ul,
.u-theme ol {
  margin: 0 0 1.2rem;
  padding-left: 1.4rem;
  color: var(--u-text-soft);
}

.u-theme li + li {
  margin-top: 0.35rem;
}

.u-theme img {
  max-width: 100%;
  height: auto;
  border-radius: var(--u-radius);
}

.u-theme small {
  color: var(--u-text-muted);
}

.u-theme label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--u-text-soft);
  font-size: 0.86rem;
  font-weight: 600;
}

.u-theme input,
.u-theme textarea,
.u-theme select,
.u-theme button {
  font: inherit;
}

.u-theme input[type="text"],
.u-theme input[type="password"],
.u-theme input[type="email"],
.u-theme input[type="number"],
.u-theme input[type="search"],
.u-theme input[type="url"],
.u-theme textarea,
.u-theme select {
  width: 100%;
  max-width: 34rem;
  padding: 0.75rem 0.95rem;
  border: 1px solid var(--u-border);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--u-text);
  line-height: 1.5;
  transition:
    border-color 0.2s var(--u-ease),
    background-color 0.2s var(--u-ease),
    box-shadow 0.2s var(--u-ease);
}

.u-theme textarea {
  min-height: 8rem;
  resize: vertical;
}

.u-theme input::placeholder,
.u-theme textarea::placeholder {
  color: var(--u-text-muted);
}

.u-theme input:focus,
.u-theme textarea:focus,
.u-theme select:focus {
  outline: none;
  border-color: rgba(159, 145, 255, 0.6);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 4px rgba(159, 145, 255, 0.12);
}

.u-theme button,
.u-theme input[type="submit"],
.u-theme input[type="button"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.25rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: linear-gradient(135deg, #8b7cff 0%, #6d5ce8 55%, #5b7cf0 100%);
  color: #fff;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition:
    transform 0.2s var(--u-ease),
    box-shadow 0.2s var(--u-ease),
    background-color 0.2s var(--u-ease);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.22) inset,
    0 12px 28px -14px rgba(124, 108, 240, 0.9);
}

.u-theme button:hover,
.u-theme input[type="submit"]:hover,
.u-theme input[type="button"]:hover {
  transform: translateY(-1px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.28) inset,
    0 18px 34px -14px rgba(124, 108, 240, 1);
}

.u-theme button:active {
  transform: translateY(0) scale(0.99);
}

.u-theme table {
  width: 100%;
  margin: 1.25rem 0;
  border-collapse: collapse;
  border: 1px solid var(--u-border);
  border-radius: var(--u-radius);
  background: rgba(10, 12, 23, 0.55);
  overflow: hidden;
}

.u-theme th,
.u-theme td {
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--u-border);
  text-align: left;
  vertical-align: top;
}

.u-theme th {
  background: rgba(255, 255, 255, 0.05);
  color: var(--u-text);
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.u-theme tr:last-child td {
  border-bottom: 0;
}

.u-theme tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.u-theme pre,
.u-theme code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.u-theme pre {
  max-width: 100%;
  padding: 1rem 1.1rem;
  border: 1px solid var(--u-border);
  border-radius: var(--u-radius);
  background: rgba(5, 6, 12, 0.75);
  color: #d9e0ff;
  font-size: 0.85rem;
  line-height: 1.55;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.u-theme code {
  padding: 0.12em 0.4em;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  color: #d9e0ff;
  font-size: 0.9em;
}

.u-theme pre code {
  padding: 0;
  background: none;
}

.u-theme blockquote {
  margin: 1.25rem 0;
  padding: 0.35rem 0 0.35rem 1rem;
  border-left: 3px solid rgba(159, 145, 255, 0.55);
  color: var(--u-text-soft);
}

/* Generic cards / wrappers used by older pages */
.u-theme .info-box,
.u-theme .copy-container,
.u-theme .card,
.u-theme .container,
.u-theme .login-box,
.u-theme .box {
  padding: clamp(1.25rem, 4vw, 2rem);
  border: 1px solid var(--u-border);
  border-radius: 18px;
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015)),
    rgba(10, 12, 23, 0.6);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 30px 70px -40px rgba(0, 0, 0, 0.9);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.u-theme .copy-container > pre,
.u-theme .info-box > :first-child,
.u-theme .card > :first-child {
  margin-top: 0;
}

.u-theme img,
.u-theme canvas,
.u-theme iframe {
  max-width: 100%;
}

@media (max-width: 560px) {
  .u-theme {
    font-size: 15px;
  }

  .u-theme > * {
    max-width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .u-theme *,
  .u-theme *::before,
  .u-theme *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
