/*
 * Masiya Hub — visual refresh
 * Loaded AFTER the inline <style> in index.html so it wins on equal specificity.
 * Visual-only: no markup, JS, CSP, routing or behaviour changes.
 * To roll back, remove the <link> to this file in index.html.
 *
 * 1. Bigger, more readable type (everything is rem-based, so the root size scales the page)
 * 2. Calmer background, roomier spacing, softer cards
 * 3. Clearer buttons, navigation and section headings
 */

/* ---------- 1. Type scale ---------- */
html {
  font-size: 112.5%;            /* 18px base (was 16px) */
  -webkit-text-size-adjust: 100%;
}

body {
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Higher-contrast secondary / muted text (dark theme) */
:root[data-theme="dark"] {
  --text-secondary: #b4c0d4;
  --text-muted: #8c9bb3;
  --bg-card: rgba(20, 29, 48, 0.72);
  --border: #263449;
}

/* Floor for the tiny monospace labels */
.kb-hint-banner,
.btn-nav-action,
.tag,
.metric-badge,
.project-badge,
.terminal-preview,
.copy-btn,
.terminal-header { font-size: max(0.85rem, 14px); }

.hero::before,
footer::before { font-size: 0.8rem; }

.project-desc,
.snapshot-card ul { font-size: 1rem; line-height: 1.7; }
.project-title { font-size: 1.4rem; line-height: 1.3; }
.hero-desc { font-size: 1.15rem; line-height: 1.8; }
.hero-subtitle-secondary,
.hero-meta { font-size: 1rem; }
.section-title { font-size: clamp(1.7rem, 3vw, 2.2rem); }

/* ---------- 2. Background, spacing, cards ---------- */
body {
  background-image:
    radial-gradient(ellipse at 50% -8%, rgba(6, 182, 212, 0.14), transparent 45%),
    radial-gradient(ellipse at 90% 30%, rgba(16, 185, 129, 0.07), transparent 40%),
    linear-gradient(var(--cyber-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--cyber-grid) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 56px 56px, 56px 56px;
}
body::after { display: none; }                 /* remove the scan-line overlay */

.container { max-width: 1240px; padding: 3rem 2rem; }

.hero { padding: 5rem 0 4.5rem; }
.hero::after { display: none; }                /* decorative "01" watermark */
.hero::before {
  letter-spacing: 0.12em;
  border-radius: 999px;
  padding: 0.5rem 1rem;
}

.hero-title {
  font-size: clamp(2.6rem, 6.5vw, 4.8rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
  background: linear-gradient(120deg, var(--text-primary) 20%, var(--accent-cyan) 60%, var(--accent-green) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1.2rem;
  line-height: 1.6;
  padding: 0.6rem 1rem;
  border-radius: 0 10px 10px 0;
}

.hero-desc { color: var(--text-secondary); }

/* the highlighted summary block in the hero */
.hero > div[style*="border-left"] {
  padding: 1.75rem 2rem !important;
  border-radius: 14px !important;
  border: 1px solid var(--border) !important;
  border-left: 4px solid var(--accent-green) !important;
  background: var(--cyber-panel) !important;
  box-shadow: var(--cyber-glow);
}

.section-header { margin: 5rem 0 2.25rem; }
.section-title { text-transform: none; letter-spacing: -0.02em; line-height: 1.2; }
.section-title::before,
.section-title::after { content: none; }       /* drop the "[ ]" decoration */
.section-header::after { width: 96px; height: 3px; border-radius: 3px; }

.grid-4 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 1.75rem; }

.card {
  border-radius: 16px;
  padding: 2rem;
  background: var(--bg-card);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 12px 32px -16px rgba(0, 0, 0, 0.55);
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(16, 185, 129, 0.45);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 20px 44px -18px rgba(16, 185, 129, 0.28);
}

.project-badge { border-radius: 999px; padding: 0.3rem 0.8rem; }
.metric-badge,
.tag { border-radius: 8px; padding: 0.3rem 0.7rem; }
.terminal-preview { border-radius: 10px; padding: 1rem 1.15rem; }
.tag-group { gap: 0.6rem; }

.snapshot-card h4 { font-size: 1.05rem; letter-spacing: 0.02em; }

/* ---------- 3. Navigation, buttons ---------- */
header { backdrop-filter: blur(16px) saturate(140%); }
/* Two-row header on desktop: logo on top, links + buttons below.
   Larger text no longer fits on one line, so let it wrap cleanly instead of squeezing. */
.nav-container {
  max-width: 1240px;
  padding: 0.8rem 1.25rem;
  min-height: 0;
  flex-wrap: wrap;
  row-gap: 0.5rem;
}
.logo { font-size: 1.1rem; white-space: nowrap; }
nav {
  flex: 1 1 100%;
  justify-content: space-between;
  gap: 0.75rem;
}
nav ul { flex-wrap: wrap; gap: 0.4rem 0.65rem; }
nav a { font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif; font-weight: 600; font-size: 0.9rem; padding-bottom: 6px; white-space: nowrap; }
.btn-nav-action { white-space: nowrap; }
nav .btn-nav-action:first-of-type { margin-left: auto; }
.btn-nav-action { padding: 0.4rem 0.65rem; border-radius: 10px; font-size: 0.85rem; }

.btn-cta-group { gap: 1rem; }
.btn-cta {
  font-size: 1rem;
  padding: 0.95rem 1.75rem;
  border-radius: 12px;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent-green), #14b8a6);
  box-shadow: 0 10px 28px -10px rgba(16, 185, 129, 0.65);
}
.btn-primary::before { content: none; }        /* drop the ">" prefix */
.btn-outline { border-color: var(--border-highlight); }
.btn-outline:hover { border-color: var(--accent-cyan); background: rgba(6, 182, 212, 0.07); }

.filter-btn { font-size: 0.9rem; padding: 0.5rem 1.05rem; border-radius: 10px; }
.btn-link, .btn-quicklook { font-size: 0.95rem; }

.modal-content { border-radius: 18px; max-width: 720px; padding: 2.25rem; }
#terminal-box,
.terminal-input-line input { font-size: 0.95rem; }

footer { font-size: 0.95rem; padding: 3rem 0; }

/* keyboard focus should always be visible */
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Light theme tweaks ---------- */
html[data-theme="light"] .card {
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 14px 32px -18px rgba(15, 23, 42, 0.25);
}
html[data-theme="light"] .hero-title {
  background: linear-gradient(120deg, #0f172a 20%, #0891b2 65%, #059669 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

/* ---------- Tablet / phone ---------- */
@media (max-width: 768px) {
  html { font-size: 106.25%; }                 /* 17px on phones */
  .container { padding: 1.75rem 1.1rem; }
  .hero { padding: 2.5rem 0 2.25rem; }
  .hero-title { font-size: clamp(2.2rem, 10vw, 3rem); }
  .hero-subtitle { font-size: 1.05rem; }
  .hero-desc { font-size: 1.05rem; }
  .hero > div[style*="border-left"] { padding: 1.25rem !important; }
  .section-header { margin: 3rem 0 1.5rem; }
  .section-title { font-size: 1.6rem; }
  .card { padding: 1.4rem; border-radius: 14px; }
  .grid-2 { grid-template-columns: 1fr; }
  header { position: static; }                  /* a tall sticky header would cover the phone screen */
  nav { justify-content: flex-start; }
  nav .btn-nav-action:first-of-type { margin-left: 0; }
  nav a { font-size: 0.9rem; }
  .logo { font-size: 0.9rem; }
  .logo::before { content: none; }              /* drop the "SEC //" prefix to save width */
}

/* ---------- Fixes for unstyled / default-styled elements ---------- */

/* Cards that are whole-card links (Flagship Labs) were picking up default blue + underline */
a.card, a.glass-card { color: inherit; text-decoration: none; }
a.card:hover .project-title { color: var(--accent-green); }

/* "Evidence Hubs" cards use .glass-card / .project-icon / .card-link, which had no styles at all */
.glass-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 2rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-card);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 12px 32px -16px rgba(0, 0, 0, 0.55);
  transition: transform 0.3s ease, border-color 0.25s, box-shadow 0.25s;
}
.glass-card:hover {
  transform: translateY(-4px);
  border-color: rgba(16, 185, 129, 0.45);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 20px 44px -18px rgba(16, 185, 129, 0.28);
}
.glass-card .project-icon { font-size: 2.1rem; line-height: 1; }
.glass-card h3 { font-size: 1.4rem; line-height: 1.3; color: var(--text-primary); }
.glass-card p { color: var(--text-secondary); font-size: 1rem; line-height: 1.7; }
.glass-card .card-link {
  margin-top: auto;
  padding-top: 0.75rem;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--accent-blue);
}
.glass-card:hover .card-link { color: var(--accent-cyan); }
html[data-theme="light"] .glass-card {
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 14px 32px -18px rgba(15, 23, 42, 0.25);
}

/* Footer links were default dark-blue on a dark background */
footer a { color: var(--accent-green); text-decoration: none; font-weight: 600; }
footer a:hover { color: var(--accent-cyan); text-decoration: underline; text-underline-offset: 3px; }
footer p { line-height: 1.9; }

/* Long code lines in the terminal previews were clipped */
.terminal-preview { overflow-wrap: anywhere; }

/* Small print written with inline styles */
#forage .card[style] p { font-size: 0.95rem !important; }
