:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #18202a;
  --muted: #66707c;
  --line: #dfe3e8;
  --accent: #315f8c;
  --accent-soft: #e8f0f7;
  --max-width: 1080px;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
}

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

a:hover {
  text-decoration: underline;
}

header {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
}

nav {
  max-width: var(--max-width);
  margin: 0 auto;
  min-height: 68px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

nav > a:first-child {
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

nav div {
  display: flex;
  gap: 24px;
}

nav div a {
  color: var(--muted);
  font-size: 0.94rem;
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

main > section:first-child {
  padding: 110px 0 100px;
  max-width: 820px;
}

main > section:first-child p:first-child {
  margin-bottom: 18px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 24px;
  font-size: clamp(2.8rem, 7vw, 5.4rem);
  line-height: 1.02;
  letter-spacing: -0.055em;
  font-weight: 750;
}

main > section:first-child p:not(:first-child) {
  max-width: 650px;
  margin-bottom: 32px;
  color: var(--muted);
  font-size: 1.12rem;
}

main > section:first-child > a {
  display: inline-block;
  padding: 11px 17px;
  border-radius: 9px;
  background: var(--text);
  color: white;
  transition: transform 160ms ease, opacity 160ms ease;
}

main > section:first-child > a:hover {
  text-decoration: none;
  transform: translateY(-2px);
  opacity: 0.9;
}

section {
  padding: 80px 0;
  border-top: 1px solid var(--line);
}

h2 {
  margin: 0 0 30px;
  font-size: 1.8rem;
  letter-spacing: -0.03em;
}

#notes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

#notes h2 {
  grid-column: 1 / -1;
}

article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

article:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(24, 32, 42, 0.07);
}

article p:first-child {
  margin-top: 0;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h3 {
  margin: 10px 0 12px;
  font-size: 1.18rem;
  line-height: 1.35;
}

article p {
  color: var(--muted);
}

#projects {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

#projects h2 {
  grid-column: 1 / -1;
}

#about {
  max-width: 720px;
}

#about p {
  color: var(--muted);
  font-size: 1.05rem;
}

footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 24px 60px;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 760px) {
  nav {
    min-height: 60px;
  }

  nav div {
    gap: 14px;
  }

  main > section:first-child {
    padding: 75px 0 70px;
  }

  #notes,
  #projects {
    grid-template-columns: 1fr;
  }

  #notes h2,
  #projects h2 {
    grid-column: auto;
  }

  section {
    padding: 60px 0;
  }
}

@media (max-width: 520px) {
  nav {
    align-items: flex-start;
    flex-direction: column;
    padding-top: 15px;
    padding-bottom: 15px;
  }

  nav div {
    width: 100%;
    justify-content: space-between;
  }

  h1 {
    font-size: 2.7rem;
  }
}

.theme-toggle {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: transform 160ms ease, background 160ms ease;
}

.theme-toggle:hover {
  transform: rotate(15deg);
}

html.dark {
  --bg: #11161c;
  --surface: #19212a;
  --text: #e7edf3;
  --muted: #9ca8b5;
  --line: #2d3742;
  --accent: #83b4df;
  --accent-soft: #233445;
}

html.dark header {
  background: rgba(17, 22, 28, 0.94);
}

html.dark main > section:first-child > a {
  background: #e7edf3;
  color: #11161c;
}

html.dark article {
  box-shadow: none;
}

html.dark article:hover {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
}

.note-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 32px;
}

.note-filters button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 15px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.note-filters button:hover,
.note-filters button.active {
  background: var(--text);
  border-color: var(--text);
  color: var(--surface);
}

.notes-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.notes-list article {
  margin: 0;
}

.notes-list article[hidden] {
  display: none;
}

@media (max-width: 760px) {
  .notes-list {
    grid-template-columns: 1fr;
  }
}
