/* SubraLabs Ops — Design System */

:root {
  --bg: #faf9f6;
  --bg-alt: #f3f1ec;
  --text: #1a1a1a;
  --text-mid: #555;
  --text-light: #888;
  --accent: #8b6f47;
  --accent-light: #c9a96e;
  --border: #e0dcd4;
  --code-bg: #1a1a1a;
  --code-text: #d4d4d4;
  --serif: 'Times New Roman', Times, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, Helvetica, Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

::selection { background: var(--accent); color: #fff; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Layout */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Header — fixed, frosted glass */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 64px;
  display: flex;
  align-items: center;
  background: rgba(250, 249, 246, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.3s ease;
}
header.scrolled {
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
}
header .header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
  width: 100%;
  display: flex;
  align-items: center;
}
header .logo {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
header .logo:hover { opacity: 0.8; }
header .badge {
  font-family: var(--sans);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 0.15rem 0.5rem;
  border-radius: 2px;
}

/* Spacer for fixed header */
.header-spacer { height: 64px; }

/* Sections */
section {
  padding: 4rem 0;
}

/* Dividers */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}

/* Status bar */
.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.25rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 2px;
  font-size: 0.8rem;
  color: var(--text-mid);
  margin-bottom: 2rem;
}

/* Report cards */
.report-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding-bottom: 4rem;
}

.report-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 1.75rem;
  text-decoration: none;
  color: inherit;
  display: block;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 8px 30px rgba(0, 0, 0, 0.06);
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              box-shadow 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.report-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 16px 40px rgba(0, 0, 0, 0.1);
}

.report-card .date {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-light);
}
.report-card .title {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 400;
  margin: 0.4rem 0 0.5rem;
  line-height: 1.3;
  color: var(--text);
}
.report-card .excerpt {
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--text-mid);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Back link */
.back {
  display: inline-block;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 2rem;
  transition: opacity 0.2s;
}
.back:hover {
  text-decoration: underline;
}

/* Empty state */
.empty {
  text-align: center;
  padding: 5rem 0;
  color: var(--text-light);
  font-size: 0.95rem;
}

/* Loading */
.loading {
  text-align: center;
  padding: 4rem 0;
  color: var(--text-light);
  font-size: 0.9rem;
}

/* ---- Report content (Markdown) ---- */
.report-content {
  padding: 2rem 0 4rem;
}

.report-content h1 {
  font-family: var(--serif);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 400;
  margin-bottom: 0.5rem;
  line-height: 1.15;
  color: var(--text);
}

.report-content .report-date {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-light);
  margin-bottom: 2rem;
  display: block;
}

.report-content h2 {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 400;
  margin: 2.5rem 0 1rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  color: var(--text);
}

.report-content h3 {
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 600;
  margin: 2rem 0 0.5rem;
  color: var(--accent);
}

.report-content h4 {
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
  color: var(--text);
}

.report-content p {
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-mid);
  margin: 1rem 0;
}

.report-content ul,
.report-content ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-mid);
}
.report-content li { margin: 0.3rem 0; }

.report-content strong { font-weight: 600; color: var(--text); }

.report-content blockquote {
  border-left: 3px solid var(--accent-light);
  padding: 0.75rem 1.5rem;
  margin: 1.5rem 0;
  background: transparent;
}
.report-content blockquote p {
  margin: 0.25rem 0;
  font-style: italic;
  color: var(--text-mid);
}

.report-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

.report-content code {
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
  background: var(--bg-alt);
  padding: 0.15rem 0.4rem;
  border-radius: 2px;
  font-size: 0.85rem;
  color: var(--accent);
}

.report-content pre {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 1.25rem 1.5rem;
  border-radius: 2px;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 0.85rem;
  line-height: 1.6;
}
.report-content pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.report-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}
.report-content th {
  font-family: var(--sans);
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid var(--border);
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.report-content td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-mid);
}
.report-content tr:last-child td { border-bottom: none; }

.report-content a {
  color: var(--accent);
  text-decoration: none;
}
.report-content a:hover {
  text-decoration: underline;
}

/* ---- Login page ---- */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.login-card {
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.login-logo {
  font-family: var(--serif);
  font-size: 1.75rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 0.25rem;
}
.login-logo .badge {
  font-family: var(--sans);
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 0.15rem 0.5rem;
  border-radius: 2px;
  vertical-align: middle;
  margin-left: 0.4rem;
}

.login-subtitle {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-top: 0.75rem;
  margin-bottom: 2.5rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.login-form input[type="password"] {
  font-family: var(--sans);
  font-size: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}
.login-form input[type="password"]:focus {
  border-color: var(--accent);
}
.login-form input[type="password"]::placeholder {
  color: var(--text-light);
}

.login-form button {
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 2px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s;
}
.login-form button:hover {
  background: #7a6240;
}

.login-error {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: #b44;
  margin-top: 0.5rem;
  display: none;
}
.login-error.visible {
  display: block;
}

/* Responsive */
@media (max-width: 640px) {
  .container { padding: 0 1.25rem; }

  header .header-inner { padding: 0 1.25rem; }

  .status-bar { flex-direction: column; gap: 0.25rem; text-align: center; }

  .report-card { padding: 1.25rem; }
  .report-card .title { font-size: 1.15rem; }

  .report-content h1 { font-size: 1.75rem; }
  .report-content h2 { font-size: 1.25rem; }
}
