/* Cyber Notes — plain HTML/CSS, dark + light theme */

:root {
  color-scheme: dark light;
  --bg: #0b0f14;
  --bg-elevated: #121922;
  --surface: #161d27;
  --border: #243044;
  --text: #e8eef5;
  --muted: #8b9cb0;
  --accent: #3d9cf0;
  --accent-dim: #2a7fc9;
  --shadow: rgba(0, 0, 0, 0.35);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6f9;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --border: #d5dde8;
  --text: #15202b;
  --muted: #5a6b7d;
  --accent: #0b6bcb;
  --accent-dim: #0956a8;
  --shadow: rgba(15, 23, 42, 0.08);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 1.02rem;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  color: var(--accent-dim);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 var(--shadow);
}

.nav-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
}

.logo {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
}

.logo:hover {
  color: var(--accent);
  text-decoration: none;
}

nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 1rem;
}

nav a {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.95rem;
}

nav a:hover,
nav a.active {
  color: var(--text);
  text-decoration: none;
}

.theme-toggle {
  margin-left: 0.25rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.85rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.theme-toggle:hover {
  border-color: var(--accent);
}

.section {
  padding: 2.5rem 0;
}

main.section:first-of-type {
  padding-top: 2rem;
}

h1 {
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  line-height: 1.2;
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.35rem;
  margin: 2rem 0 1rem;
}

h3 {
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
}

.lead {
  font-size: 1.1rem;
  color: var(--muted);
  margin: 0 0 1.5rem;
  max-width: 48rem;
}

.lead-tight {
  font-size: 1rem;
  margin-bottom: 1rem;
}

.meta {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0 0 0.35rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.35rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 12px var(--shadow);
}

.panel ul {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
}

.hero {
  padding: 2rem 0 1rem;
}

.hero-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .hero-grid {
    grid-template-columns: 1.2fr 1fr;
    align-items: start;
  }
}

.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.35rem;
}

.hero-card > h3:first-child {
  margin-top: 0;
}

.search-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.search-bar input[type="search"] {
  flex: 1 1 14rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.filter-btn {
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
}

.filter-btn:hover,
.filter-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.notes-result {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.notes-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 560px) {
  .notes-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .notes-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.searchable-note {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 8rem;
  transition: border-color 0.15s ease;
  text-decoration: none;
  color: inherit;
}

a.searchable-note:hover {
  border-color: var(--accent);
  text-decoration: none;
  color: inherit;
}

.searchable-note h3 {
  margin: 0;
  font-size: 1rem;
}

.searchable-note p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
  flex: 1;
}

.searchable-note .read-more {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--accent);
  margin-top: auto;
}

a.searchable-note:hover .read-more {
  text-decoration: underline;
  color: var(--accent-dim);
}

.post-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.35rem;
}

.post-card h2 {
  margin: 0.35rem 0 0.5rem;
  font-size: 1.2rem;
}

.post-card p {
  margin: 0 0 0.75rem;
  color: var(--muted);
}

.tag {
  display: inline-block;
  margin: 0.25rem 0.35rem 0 0;
  padding: 0.2rem 0.55rem;
  font-size: 0.78rem;
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--text);
}

main.article .lead {
  margin-bottom: 1.25rem;
}

main.article p,
main.article li {
  max-width: 52rem;
}

.contact-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .contact-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.site-footer {
  margin-top: auto;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
  font-size: 0.92rem;
  color: var(--muted);
  text-align: center;
}

.site-footer p {
  margin: 0;
}
