/* =========================================================================
   Hand-written stylesheet (replaces Tailwind CDN).
   Only rules used by this site are included; see CLAUDE.md for rationale.
   ========================================================================= */

:root {
  --color-primary: #005fa9;
  --color-primary-dark: #334d55;
  --color-section: #006699;

  --color-white: #ffffff;
  --color-gray-50: #f9fafb;
  --color-gray-100: #f3f4f6;
  --color-gray-200: #e5e7eb;
  --color-gray-300: #d1d5db;
  --color-gray-400: #9ca3af;
  --color-gray-500: #6b7280;
  --color-gray-600: #4b5563;
  --color-gray-700: #374151;
  --color-gray-800: #1f2937;
  --color-gray-900: #111827;

  --color-blue-400: #60a5fa;
  --color-blue-500: #3b82f6;
  --color-blue-600: #2563eb;
  --color-blue-700: #1d4ed8;

  --color-red-50: #fef2f2;
  --color-red-100: #fee2e2;
  --color-red-400: #f87171;
  --color-red-600: #dc2626;
  --color-red-800: #991b1b;
  --color-red-900: #7f1d1d;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, h5, h6, p, ul, ol, figure { margin: 0; }
ul, ol { padding-left: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
img, svg { display: block; max-width: 100%; }
select {
  font: inherit; color: inherit; background: var(--color-white);
  border: 1px solid var(--color-gray-300); border-radius: 0.375rem;
  padding: 0.25rem 0.5rem;
}

.antialiased { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

/* ---------- Layout ---------- */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.block { display: block; }
.hidden { display: none; }
.grid { display: grid; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1 1 0%; }
.flex-grow { flex-grow: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.top-1\.5 { top: 0.375rem; }
.bottom-8 { bottom: 2rem; }
.right-8 { right: 2rem; }
.-left-\[9px\] { left: -9px; }
.z-50 { z-index: 50; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mt-auto { margin-top: auto; }

.max-w-4xl { max-width: 56rem; }
.max-w-7xl { max-width: 80rem; }
.min-h-screen { min-height: 100vh; }
.min-w-0 { min-width: 0; }
.w-3 { width: 0.75rem; }
.w-4 { width: 1rem; }
.w-5 { width: 1.25rem; }
.w-8 { width: 2rem; }
.w-48 { width: 12rem; }
.w-full { width: 100%; }
.h-3 { height: 0.75rem; }
.h-4 { height: 1rem; }
.h-5 { height: 1.25rem; }
.h-8 { height: 2rem; }
.h-48 { height: 12rem; }

/* ---------- Spacing ---------- */
.p-0\.5 { padding: 0.125rem; }
.p-1\.5 { padding: 0.375rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.pb-4 { padding-bottom: 1rem; }
.pl-5 { padding-left: 1.25rem; }
.pl-6 { padding-left: 1.5rem; }
.pl-8 { padding-left: 2rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-10 { margin-bottom: 2.5rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mr-1\.5 { margin-right: 0.375rem; }
.ml-3 { margin-left: 0.75rem; }
.ml-6 { margin-left: 1.5rem; }

.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-8 > * + * { margin-top: 2rem; }
.space-y-10 > * + * { margin-top: 2.5rem; }

/* ---------- Typography ---------- */
.text-xs   { font-size: 0.75rem;  line-height: 1rem; }
.text-sm   { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem;     line-height: 1.5rem; }
.text-lg   { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl   { font-size: 1.25rem;  line-height: 1.75rem; }
.text-2xl  { font-size: 1.5rem;   line-height: 2rem; }
.text-3xl  { font-size: 1.875rem; line-height: 2.25rem; }
.font-medium   { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }
.leading-relaxed { line-height: 1.625; }
.text-center { text-align: center; }
.text-justify { text-align: justify; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hover\:underline:hover { text-decoration: underline; }

/* ---------- Colors: text ---------- */
.text-white { color: var(--color-white); }
.text-gray-400 { color: var(--color-gray-400); }
.text-gray-500 { color: var(--color-gray-500); }
.text-gray-600 { color: var(--color-gray-600); }
.text-gray-700 { color: var(--color-gray-700); }
.text-gray-800 { color: var(--color-gray-800); }
.text-gray-900 { color: var(--color-gray-900); }
.text-blue-600 { color: var(--color-blue-600); }
.text-red-600  { color: var(--color-red-600); }
.text-primary { color: var(--color-primary); }
.text-primary-dark { color: var(--color-primary-dark); }
.text-section { color: var(--color-section); }

/* ---------- Colors: background ---------- */
.bg-white    { background-color: var(--color-white); }
.bg-gray-50  { background-color: var(--color-gray-50); }
.bg-gray-200 { background-color: var(--color-gray-200); }
.bg-primary  { background-color: var(--color-primary); }
.bg-red-50   { background-color: var(--color-red-50); }
.bg-primary\/10 { background-color: rgb(0 95 169 / 0.1); }

/* ---------- Colors: border ---------- */
.border-white     { border-color: var(--color-white); }
.border-gray-100  { border-color: var(--color-gray-100); }
.border-gray-200  { border-color: var(--color-gray-200); }
.border-gray-300  { border-color: var(--color-gray-300); }
.border-red-100   { border-color: var(--color-red-100); }

/* ---------- Borders / radius / shadow ---------- */
/* .border / .border-b / .border-t / .border-l-2 set only width+style.
   Color comes from the companion .border-gray-* / .dark:border-* classes. */
.border   { border-width: 1px; border-style: solid; }
.border-2 { border-width: 2px; border-style: solid; }
.border-b { border-bottom-width: 1px; border-bottom-style: solid; }
.border-t { border-top-width: 1px; border-top-style: solid; }
.border-l-2 { border-left-width: 2px; border-left-style: solid; }
.border-dashed { border-style: dashed; }

.rounded-full { border-radius: 9999px; }
.rounded-md   { border-radius: 0.375rem; }
.rounded-lg   { border-radius: 0.5rem; }

.shadow-sm { box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); }
.shadow-md { box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); }

/* ---------- Effects ---------- */
.opacity-25 { opacity: 0.25; }
.opacity-75 { opacity: 0.75; }
.object-cover { object-fit: cover; }
.transition-colors { transition-property: color, background-color, border-color, fill, stroke; transition-duration: 150ms; transition-timing-function: cubic-bezier(0.4,0,0.2,1); }
.transition-all    { transition-property: all; transition-duration: 150ms; transition-timing-function: cubic-bezier(0.4,0,0.2,1); }
.duration-200 { transition-duration: 200ms; }
.duration-300 { transition-duration: 300ms; }

.hover\:scale-105:hover { transform: scale(1.05); }
.hover\:scale-110:hover { transform: scale(1.10); }
.hover\:shadow-sm:hover { box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); }
.hover\:shadow-lg:hover { box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); }
.hover\:bg-primary-dark:hover { background-color: var(--color-primary-dark); }
.hover\:bg-primary\/20:hover  { background-color: rgb(0 95 169 / 0.2); }
.hover\:bg-red-100:hover      { background-color: var(--color-red-100); }
.hover\:border-primary:hover  { border-color: var(--color-primary); }
.hover\:text-gray-900:hover   { color: var(--color-gray-900); }

.focus\:outline-none:focus   { outline: 2px solid transparent; outline-offset: 2px; }
.focus\:ring-2:focus         { box-shadow: 0 0 0 2px var(--color-primary); }
.focus\:ring-primary:focus   { box-shadow: 0 0 0 2px var(--color-primary); }
.focus\:border-transparent:focus { border-color: transparent; }

/* ---------- Lists ---------- */
.list-disc    { list-style-type: disc; padding-left: 1.5rem; }
.list-decimal { list-style-type: decimal; padding-left: 1.5rem; }

/* ---------- Animations ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
.animate-spin { animation: spin 1s linear infinite; }

/* ---------- Group hover ---------- */
.group:hover .group-hover\:text-primary { color: var(--color-primary); }

/* =========================================================================
   Responsive: md (>=768px), lg (>=1024px)
   ========================================================================= */
@media (min-width: 768px) {
  .md\:flex-row { flex-direction: row; }
  .md\:items-center { align-items: center; }
  .md\:justify-between { justify-content: space-between; }
  .md\:p-8 { padding: 2rem; }
  .md\:pl-10 { padding-left: 2.5rem; }
  .md\:ml-4 { margin-left: 1rem; }
  .md\:w-80 { width: 20rem; }
  .md\:border-r { border-right-width: 1px; border-right-style: solid; }
}
@media (min-width: 1024px) {
  .lg\:p-10 { padding: 2.5rem; }
  .lg\:w-96 { width: 24rem; }
}

/* =========================================================================
   Dark mode (activated when [data-theme="dark"] is set on <html>)
   ========================================================================= */
[data-theme="dark"] { color-scheme: dark; }

[data-theme="dark"] .dark\:bg-gray-600 { background-color: var(--color-gray-600); }
[data-theme="dark"] .dark\:bg-gray-700 { background-color: var(--color-gray-700); }
[data-theme="dark"] .dark\:bg-gray-800 { background-color: var(--color-gray-800); }
[data-theme="dark"] .dark\:bg-gray-900 { background-color: var(--color-gray-900); }
[data-theme="dark"] .dark\:bg-blue-400\/10 { background-color: rgb(96 165 250 / 0.1); }
[data-theme="dark"] .dark\:bg-blue-500     { background-color: var(--color-blue-500); }
[data-theme="dark"] .dark\:bg-blue-600     { background-color: var(--color-blue-600); }
[data-theme="dark"] .dark\:bg-red-400\/10  { background-color: rgb(248 113 113 / 0.1); }
[data-theme="dark"] .dark\:bg-red-900\/20  { background-color: rgb(127 29 29 / 0.2); }

[data-theme="dark"] .dark\:border-gray-600 { border-color: var(--color-gray-600); }
[data-theme="dark"] .dark\:border-gray-700 { border-color: var(--color-gray-700); }
[data-theme="dark"] .dark\:border-gray-800 { border-color: var(--color-gray-800); }
[data-theme="dark"] .dark\:border-red-800  { border-color: var(--color-red-800); }

[data-theme="dark"] .dark\:text-blue-400 { color: var(--color-blue-400); }
[data-theme="dark"] .dark\:text-gray-100 { color: var(--color-gray-100); }
[data-theme="dark"] .dark\:text-gray-200 { color: var(--color-gray-200); }
[data-theme="dark"] .dark\:text-gray-300 { color: var(--color-gray-300); }
[data-theme="dark"] .dark\:text-gray-400 { color: var(--color-gray-400); }
[data-theme="dark"] .dark\:text-red-400  { color: var(--color-red-400); }

[data-theme="dark"] .dark\:focus\:ring-blue-400:focus { box-shadow: 0 0 0 2px var(--color-blue-400); }

[data-theme="dark"] .dark\:hover\:bg-blue-400\/20:hover { background-color: rgb(96 165 250 / 0.2); }
[data-theme="dark"] .dark\:hover\:bg-blue-700:hover     { background-color: var(--color-blue-700); }
[data-theme="dark"] .dark\:hover\:bg-red-400\/20:hover  { background-color: rgb(248 113 113 / 0.2); }
[data-theme="dark"] .dark\:hover\:border-blue-400:hover { border-color: var(--color-blue-400); }
[data-theme="dark"] .dark\:hover\:text-gray-100:hover   { color: var(--color-gray-100); }
[data-theme="dark"] .dark\:hover\:text-gray-200:hover   { color: var(--color-gray-200); }

[data-theme="dark"] .group:hover .dark\:group-hover\:text-blue-400 { color: var(--color-blue-400); }

/* =========================================================================
   Component classes (previously defined via Tailwind @apply on pub.html)
   ========================================================================= */
.section-gap { margin-bottom: 2.5rem; }
.section-title {
  font-size: 1.25rem; line-height: 1.75rem; font-weight: 700;
  color: var(--color-section); margin-bottom: 0.5rem;
}
[data-theme="dark"] .section-title { color: var(--color-blue-400); }
.section-subtitle {
  font-size: 0.875rem; line-height: 1.25rem;
  color: var(--color-gray-600); margin-bottom: 1rem;
}
[data-theme="dark"] .section-subtitle { color: var(--color-gray-400); }

.meta-list {
  font-size: 0.75rem; line-height: 1rem;
  color: var(--color-gray-500);
}
.meta-list > * + * { margin-top: 0.25rem; }
[data-theme="dark"] .meta-list { color: var(--color-gray-400); }

.pub-ol { list-style-type: decimal; padding-left: 1.5rem; }
.pub-ol > * + * { margin-top: 1rem; }
.pub-li { font-size: 0.875rem; line-height: 1.625; }
.pub-link {
  color: var(--color-primary); font-weight: 600;
}
.pub-link:hover { text-decoration: underline; }
[data-theme="dark"] .pub-link { color: var(--color-blue-400); }

.rank-note { font-size: 0.75rem; line-height: 1rem; color: var(--color-gray-500); }
[data-theme="dark"] .rank-note { color: var(--color-gray-400); }

/* =========================================================================
   Theme toggle (preserved from original)
   ========================================================================= */
.theme-toggle button.active {
  background-color: var(--color-white);
  color: var(--color-gray-800);
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}
[data-theme="dark"] .theme-toggle button.active {
  background-color: var(--color-gray-800);
  color: var(--color-white);
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
}

/* ---------- RTL ---------- */
[dir="rtl"] {
  font-family: 'Arial Unicode MS', 'Tahoma', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ---------- Scrollbar (used on slides page) ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #475569; }

/* ---------- Print ---------- */
@media print {
  nav button,
  nav select,
  #backToTop,
  footer { display: none !important; }
}
