/* notes.css — layout and typography for application-note pages.
   Loaded after styles.css; relies on its custom properties. */

.note-page {
  padding-top: calc(var(--header-height) + 64px);
  padding-bottom: clamp(80px, 10vw, 140px);
}

.note-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 40px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
}

.note-breadcrumb:hover {
  color: var(--accent);
}

.note-article {
  max-width: 760px;
}

.note-header {
  margin-bottom: clamp(40px, 6vw, 64px);
  padding-bottom: clamp(28px, 4vw, 40px);
  border-bottom: 1px solid var(--line);
}

.note-header h1 {
  margin-bottom: 24px;
  font-size: clamp(2.2rem, 4.6vw, 3.9rem);
  font-weight: 680;
  letter-spacing: -0.05em;
  line-height: 1.02;
}

.note-header .lead {
  margin-bottom: 30px;
  color: var(--muted);
  font-family: var(--serif);
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  line-height: 1.4;
}

.note-byline {
  display: flex;
  padding: 0;
  list-style: none;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 0;
  color: var(--faint);
  font-size: 12px;
  font-weight: 650;
}

.note-byline strong {
  color: var(--ink);
}

.note-byline li {
  position: relative;
  list-style: none;
}

.note-byline li:not(:last-child)::after {
  position: absolute;
  top: 50%;
  right: -13px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--line-strong);
  content: "";
}

.note-article section {
  margin-bottom: clamp(40px, 6vw, 60px);
}

.note-article h2 {
  margin: 0 0 18px;
  font-size: clamp(1.45rem, 2.6vw, 1.95rem);
  font-weight: 680;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.note-article p {
  margin-bottom: 18px;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.7;
}

.note-article p:last-child {
  margin-bottom: 0;
}

.note-article a {
  color: var(--accent);
  text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent);
  text-underline-offset: 4px;
}

.note-article code {
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.86em;
}

.note-article pre {
  margin: 0 0 22px;
  padding: 18px 22px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-deep);
  font-size: 13.5px;
  line-height: 1.6;
  tab-size: 4;
}

.note-article pre.script {
  max-height: 34rem;
  overflow: auto;
}

.note-article pre code {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: inherit;
  color: var(--ink);
}

.equation {
  margin: 8px 0 22px;
  padding: 16px 22px;
  border-left: 2px solid var(--accent);
  background: color-mix(in srgb, var(--surface-raised) 70%, transparent);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.6;
}

.equation sub,
.equation sup {
  line-height: 0;
}

.note-article figure {
  margin: 34px 0;
}

.note-figure-frame {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  box-shadow: var(--shadow);
}

.note-figure-frame img {
  width: 100%;
}

.note-article figcaption {
  margin-top: 14px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.6;
}

.note-article figcaption strong {
  color: var(--ink);
}

.note-article ul.resources {
  margin: 0;
  padding: 0;
  list-style: none;
}

.note-article ul.resources li {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.note-article ul.resources a {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 700;
}

.note-footer {
  margin-top: clamp(40px, 6vw, 64px);
  padding-top: 28px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.note-footer p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

.note-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

@media (max-width: 680px) {
  .note-page {
    padding-top: calc(var(--header-height) + 40px);
  }

  .note-article p {
    font-size: 16px;
  }

  .note-article pre {
    padding: 14px 16px;
    font-size: 12.5px;
  }

  .equation {
    font-size: 1.05rem;
    padding: 12px 16px;
  }
}
