@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=DM+Serif+Display:ital@0;1&display=swap');

:root {
  --primary-dark: #0f172a;
  --primary: #0c1a2e;
  --primary-mid: #0891b2;
  --primary-light: #22d3ee;
  --accent: #0369a1;
  --accent-light: #38bdf8;
  --text-dark: #1e293b;
  --text-light: #f8fafc;
  --text-muted: #94a3b8;
  --text-body: #cbd5e1;
  --background: #f8fafc;
  --background-alt: #f1f5f9;
  --border: #e2e8f0;
  --shadow: rgba(0, 0, 0, 0.1);
  --success: #10b981;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  background-color: var(--background);
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Header ──────────────────────────────────── */
header {
  background: linear-gradient(135deg, #0f172a 0%, #0c1a2e 60%, #0a2540 100%);
  color: var(--text-light);
  padding: 3rem 0;
  text-align: center;
  border-bottom: 1px solid rgba(6, 182, 212, 0.2);
}

.header-content h1 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 2.5rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.header-content h2 {
  font-size: 1.1rem;
  font-weight: 400;
  margin-bottom: 1.5rem;
  color: var(--primary-light);
  opacity: 0.9;
}

.author {
  font-size: 0.95rem;
  opacity: 0.7;
  margin-bottom: 2rem;
}

.patent-pending {
  font-size: 0.75rem;
  margin-top: 0.5rem;
  color: var(--accent-light);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ── Access Notice (header) ─────────────────── */
.access-notice {
  margin-top: 2rem;
  padding: 1.5rem 2rem;
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-radius: 0.75rem;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.notice-icon {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
}

.notice-text {
  font-size: 0.9rem;
  color: var(--text-body);
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

.request-btn {
  display: inline-block;
  background: linear-gradient(to right, var(--primary-mid), var(--accent));
  color: #fff;
  text-decoration: none;
  padding: 0.75rem 1.75rem;
  border-radius: 3rem;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.25s ease;
  box-shadow: 0 4px 16px rgba(6, 182, 212, 0.25);
  cursor: pointer;
  border: none;
}

.request-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(6, 182, 212, 0.35);
}

/* ── Navigation ─────────────────────────────── */
nav {
  background-color: #0c1a2e;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  border-bottom: 1px solid rgba(6, 182, 212, 0.15);
}

nav ul {
  display: flex;
  list-style: none;
  overflow-x: auto;
  padding: 0.375rem 0;
}

nav li {
  flex-shrink: 0;
}

nav a {
  display: block;
  color: #94a3b8;
  text-decoration: none;
  padding: 0.625rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.2s, background 0.2s;
  border-radius: 0.25rem;
}

nav a:hover {
  color: var(--primary-light);
  background: rgba(6, 182, 212, 0.08);
}

/* ── Main Layout ────────────────────────────── */
main {
  display: flex;
  gap: 2rem;
  padding: 2rem 0;
}

.sidebar {
  width: 300px;
  flex-shrink: 0;
}

.content {
  flex-grow: 1;
  min-width: 0;
}

/* ── Table of Contents ──────────────────────── */
.toc {
  background: var(--background-alt);
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
  position: sticky;
  top: 4rem;
}

.toc h3 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  margin-bottom: 1rem;
}

.toc ul {
  list-style: none;
}

.toc ul ul {
  margin-left: 1.25rem;
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
}

.toc a {
  display: block;
  padding: 0.25rem 0;
  color: var(--text-dark);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
}

.toc a:hover {
  color: var(--primary-mid);
}

/* ── Access Widget (sidebar) ────────────────── */
.access-widget {
  background: linear-gradient(135deg, #0c1a2e, #0f2744);
  border: 1px solid rgba(6, 182, 212, 0.25);
  color: var(--text-light);
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.access-widget h3 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--primary-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sidebar-request-btn {
  display: block;
  background: linear-gradient(to right, var(--primary-mid), var(--accent));
  color: #fff;
  text-decoration: none;
  padding: 0.625rem 1rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.85rem;
  text-align: center;
  transition: all 0.25s ease;
  margin-bottom: 0.75rem;
  border: none;
  cursor: pointer;
  width: 100%;
}

.sidebar-request-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.widget-note {
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1.5;
}

/* ── Author Bio ─────────────────────────────── */
.author-bio {
  background: var(--background-alt);
  border-radius: 0.75rem;
  padding: 1.5rem;
  border: 1px solid var(--border);
}

.author-bio h3 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  margin-bottom: 1rem;
}

.author-image {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1rem;
  display: block;
  border: 2px solid var(--primary-mid);
}

.author-bio p {
  font-size: 0.85rem;
  color: #475569;
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.contact-link {
  display: inline-block;
  background: var(--primary-mid);
  color: #fff;
  padding: 0.4rem 1rem;
  border-radius: 0.375rem;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background 0.2s;
}

.contact-link:hover {
  background: var(--accent);
}

/* ── Paper Sections ─────────────────────────── */
.paper-section {
  margin-bottom: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--border);
}

.paper-section:last-child {
  border-bottom: none;
}

.paper-section h2 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.875rem;
  color: #1e293b;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e2e8f0;
}

.paper-section h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary-mid);
  margin: 1.5rem 0 0.75rem;
}

.paper-section h4 {
  font-size: 1rem;
  font-weight: 600;
  color: #334155;
  margin: 1rem 0 0.5rem;
}

.paper-section p {
  margin-bottom: 1rem;
  line-height: 1.75;
  color: #374151;
}

.paper-section ul,
.paper-section ol {
  margin: 0.75rem 0 1.25rem 1.5rem;
  color: #374151;
}

.paper-section li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.paper-section strong {
  color: #1e293b;
  font-weight: 600;
}

/* ── Public Safe Note ───────────────────────── */
.public-safe-note {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-left: 4px solid var(--primary-mid);
  padding: 1.25rem 1.5rem;
  border-radius: 0 0.5rem 0.5rem 0;
  margin: 1.75rem 0 0;
}

.public-safe-note p {
  margin: 0;
  font-size: 0.875rem;
  color: #0c4a6e;
  line-height: 1.65;
}

/* ── Architecture Diagram ───────────────────── */
.architecture-diagram {
  margin: 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.layer {
  background: linear-gradient(to right, #0c1a2e, #0c2340);
  color: var(--text-light);
  padding: 0.875rem 1.25rem;
  border-radius: 0.5rem;
  border-left: 3px solid var(--primary-mid);
}

.layer h4 {
  margin: 0 0 0.25rem;
  font-size: 0.9rem;
  color: var(--primary-light);
}

.layer p {
  margin: 0;
  font-size: 0.85rem;
  color: #94a3b8;
}

/* ── Validates Grid ─────────────────────────── */
.validates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.validates-card {
  background: var(--background-alt);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.25rem;
  transition: border-color 0.2s, background 0.2s;
}

.validates-card:hover {
  border-color: #bae6fd;
  background: #f0f9ff;
}

.validates-card h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary-mid);
  margin-bottom: 0.5rem;
}

.validates-card p {
  font-size: 0.85rem;
  color: #475569;
  margin: 0;
  line-height: 1.55;
}

/* ── Pathway Steps ──────────────────────────── */
.pathway-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 1.5rem 0;
}

.pathway-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 120px;
  flex: 1;
}

.step-number {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: #0c1a2e;
  border: 2px solid var(--primary-mid);
  color: var(--primary-light);
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.step-content h4 {
  font-size: 0.8rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 0.25rem;
}

.step-content p {
  font-size: 0.75rem;
  color: #64748b;
  margin: 0;
}

.pathway-arrow {
  color: #94a3b8;
  font-size: 1.25rem;
  flex-shrink: 0;
}

/* ── F5 Notice ──────────────────────────────── */
.f5-notice {
  background: var(--background-alt);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
  margin-top: 1.5rem;
}

.f5-notice p {
  font-size: 0.9rem;
  color: #374151;
  margin-bottom: 0.75rem;
}

.f5-notice p:last-child {
  margin-bottom: 0;
}

.f5-disclaimer {
  font-size: 0.8rem !important;
  color: #94a3b8 !important;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
  margin-top: 0.75rem;
}

/* ── Confidential Notice (form header) ─────── */
.confidential-notice {
  display: flex;
  gap: 1rem;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  align-items: flex-start;
}

.notice-icon-inline {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.confidential-notice strong {
  display: block;
  font-size: 0.9rem;
  color: #0c4a6e;
  margin-bottom: 0.5rem;
}

.confidential-notice p {
  font-size: 0.875rem;
  color: #0c4a6e;
  margin: 0;
  line-height: 1.6;
}

/* ── Request Access Form ────────────────────── */
#access-form {
  background: var(--background-alt);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.375rem;
}

.required {
  color: #ef4444;
}

.optional {
  color: #94a3b8;
  font-weight: 400;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  padding: 0.625rem 0.875rem;
  font-size: 0.9rem;
  color: #1e293b;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--primary-mid);
  box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.12);
}

.form-group textarea {
  resize: vertical;
}

.field-error {
  display: block;
  font-size: 0.8rem;
  color: #ef4444;
  margin-top: 0.375rem;
  min-height: 1rem;
}

.checkbox-group {
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  padding: 1rem;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  margin-top: 0.125rem;
  accent-color: var(--primary-mid);
}

.checkbox-label span {
  font-size: 0.875rem;
  color: #374151;
  line-height: 1.5;
}

.submit-btn {
  width: 100%;
  background: linear-gradient(to right, var(--primary-mid), var(--accent));
  color: #fff;
  border: none;
  padding: 0.875rem 2rem;
  border-radius: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  margin-top: 1.25rem;
  font-family: inherit;
  box-shadow: 0 4px 14px rgba(8, 145, 178, 0.25);
}

.submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(8, 145, 178, 0.35);
}

/* ── Form Success ────────────────────────────── */
.form-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 1rem;
  padding: 2.5rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

.success-icon {
  width: 3rem;
  height: 3rem;
  background: var(--success);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 auto 1rem;
}

.form-success h3 {
  font-size: 1.2rem;
  color: #14532d;
  margin-bottom: 0.5rem;
}

.form-success p {
  font-size: 0.9rem;
  color: #166534;
  margin: 0;
}

/* ── Public Overview CTA ────────────────────── */
.public-overview-cta {
  background: var(--background-alt);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.cta-label {
  font-weight: 600;
  font-size: 0.9rem;
  color: #1e293b;
  margin-bottom: 0.25rem;
}

.cta-desc {
  font-size: 0.8rem;
  color: #64748b;
  margin: 0;
}

.public-overview-btn {
  flex-shrink: 0;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.2s, color 0.2s;
  white-space: nowrap;
}

.public-overview-btn:hover {
  border-color: var(--primary-mid);
  color: var(--primary-mid);
}

/* ── Contact Section ────────────────────────── */
.contact-info {
  background: var(--background-alt);
  padding: 2rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
}

.contact-info p {
  margin-bottom: 0.75rem;
  color: #374151;
}

.contact-info a {
  color: var(--primary-mid);
  text-decoration: none;
  transition: color 0.2s;
}

.contact-info a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.tags {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tags span {
  background: rgba(8, 145, 178, 0.1);
  color: var(--primary-mid);
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.8rem;
  border: 1px solid rgba(8, 145, 178, 0.2);
}

.ip-notice {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.ip-notice p {
  font-size: 0.85rem;
  color: #64748b;
  margin: 0;
  line-height: 1.65;
}

/* ── Footer ─────────────────────────────────── */
footer {
  background: #0f172a;
  color: var(--text-light);
  padding: 2rem 0;
  text-align: center;
  border-top: 1px solid rgba(6, 182, 212, 0.15);
}

footer p {
  font-size: 0.8rem;
  color: #475569;
  line-height: 1.65;
  max-width: 700px;
  margin: 0 auto 0.75rem;
}

.back-link {
  display: inline-block;
  color: var(--accent-light);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
}

.back-link:hover {
  color: white;
  text-decoration: underline;
}

/* ── Responsive ──────────────────────────────── */
@media (max-width: 1024px) {
  main {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
  }

  .toc {
    position: static;
  }

  .access-widget,
  .author-bio {
    position: static;
  }
}

@media (max-width: 768px) {
  .header-content h1 {
    font-size: 1.875rem;
  }

  .header-content h2 {
    font-size: 1rem;
  }

  nav a {
    padding: 0.5rem 0.75rem;
    font-size: 0.78rem;
  }

  .paper-section h2 {
    font-size: 1.5rem;
  }

  .validates-grid {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .pathway-steps {
    flex-direction: column;
    align-items: flex-start;
  }

  .pathway-arrow {
    transform: rotate(90deg);
    align-self: center;
  }

  .public-overview-cta {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .header-content h1 {
    font-size: 1.5rem;
  }

  .container {
    padding: 0 1rem;
  }

  #access-form {
    padding: 1.25rem;
  }

  .contact-info {
    padding: 1.25rem;
  }
}

/* ── Print ───────────────────────────────────── */
@media print {
  body {
    background: white;
    font-size: 11pt;
  }

  nav, .sidebar, .access-notice, .access-widget, #access-form, .form-success, .public-overview-cta {
    display: none;
  }

  .content {
    width: 100%;
  }

  .paper-section {
    page-break-inside: avoid;
  }

  a {
    color: black;
    text-decoration: none;
  }

  header {
    background: none;
    color: black;
    border: none;
  }

  .header-content h1 {
    font-size: 22pt;
    color: black;
  }

  .header-content h2 {
    font-size: 14pt;
    color: #333;
  }

  .layer {
    border: 1px solid #ccc;
    background: none;
    color: black;
  }

  .public-safe-note {
    border: 1px solid #ccc;
    background: none;
  }

  footer {
    background: none;
    color: black;
    border: none;
  }
}
