/* Site-wide layout safety: long text must not cause horizontal page scroll */

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

html {
  overflow-x: clip;
  max-width: 100%;
}

body {
  margin: 0;
  overflow-x: clip;
  max-width: 100%;
  overflow-wrap: break-word;
}

img,
video,
iframe,
embed,
object {
  max-width: 100%;
}

pre {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

pre code {
  white-space: pre;
  word-break: normal;
  overflow-wrap: normal;
}

code {
  overflow-wrap: anywhere;
}

a {
  overflow-wrap: anywhere;
}

.page-shell {
  max-width: 100%;
  overflow-x: clip;
  box-sizing: border-box;
}

.page-shell > .page-inner,
.page-main {
  min-width: 0;
  max-width: 100%;
}

.page-inner {
  container-type: inline-size;
  container-name: page;
}

.page-title {
  font-size: clamp(1.625rem, 4vw + 0.75rem, 2.75rem);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin: 0;
  text-wrap: balance;
  max-width: 100%;
}

@supports (container-type: inline-size) {
  .page-title {
    font-size: clamp(1.625rem, 5cqi + 0.75rem, 2.75rem);
  }
}

.page-title--spaced {
  margin-bottom: 12px;
}

.page-title--compact {
  font-size: clamp(1.5rem, 3.5vw + 0.5rem, 2.125rem);
}

@supports (container-type: inline-size) {
  .page-title--compact {
    font-size: clamp(1.5rem, 4.5cqi + 0.5rem, 2.125rem);
  }
}

#cms > div {
  container-type: inline-size;
}

#cv-header {
  container-type: inline-size;
}

#cv-header-left {
  flex: 1 1 auto;
  min-width: 0;
}

#cv-name {
  font-size: clamp(1.75rem, 4vw + 0.5rem, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

@supports (container-type: inline-size) {
  #cv-name {
    font-size: clamp(1.75rem, 7cqi + 0.5rem, 2.5rem);
  }
}

.site-header {
  min-width: 0;
  max-width: 100%;
}

.site-header__back {
  min-width: 0;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
li,
td,
th,
blockquote,
figcaption,
label {
  overflow-wrap: break-word;
}

.post-body,
.doc-body,
.privacy-section,
#cv-additional,
.proj-body-inner {
  overflow-wrap: break-word;
  word-break: break-word;
}

.post-body table,
.doc-body table {
  width: 100%;
  max-width: 100%;
  table-layout: fixed;
}

.post-body th,
.post-body td,
.doc-body th,
.doc-body td {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.post-title,
.doc-title,
.bento-name,
#cv-name {
  overflow-wrap: anywhere;
}

.doc-excerpt,
.doc-project,
.post-excerpt {
  overflow-wrap: break-word;
  word-break: break-word;
}

.cv-contact-line,
.cv-contact-row,
.proj-domain {
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}

#cv-header-right,
#sheet,
#sheet-grid,
#cv-contacts,
#cv-skills,
#cv-edu,
#cv-certs,
#cv-langs,
#cv-exp,
#cv-projects,
#cv-summary,
#cv-additional,
#cv-metrics {
  min-width: 0;
  max-width: 100%;
}

.doc-head > :first-child,
.proj-head > :first-child,
.post-head-body {
  min-width: 0;
}

.chip {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.privacy-section code {
  overflow-wrap: anywhere;
  word-break: break-word;
}

#error-page {
  max-width: 100%;
  overflow-x: clip;
}

/* Site-wide modal overlays: top layer, dimmed backdrop, block page interaction */
:root {
  --nq-z-modal: 100000;
  --nq-z-modal-nested: 100010;
  --nq-z-modal-top: 100020;
}

.nq-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--nq-z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  background: rgba(0, 0, 0, .45);
  pointer-events: auto;
}

.nq-modal-overlay--nested {
  z-index: var(--nq-z-modal-nested);
}

.nq-modal-overlay--top {
  z-index: var(--nq-z-modal-top);
}

.nq-modal-overlay > * {
  pointer-events: auto;
}

body.nq-modal-open {
  overflow: hidden;
}

body.nq-modal-open #qa-roach,
body.nq-modal-open .qa-roach-perch {
  pointer-events: none !important;
}

.nq-embed-preview-wrap--image {
  position: relative;
  display: block;
  width: fit-content;
  max-width: 100%;
}

.post-body .nq-embed-preview-wrap--image,
.doc-body .nq-embed-preview-wrap--image {
  margin: 16px 0;
}

.post-body .nq-embed-preview-wrap--image > img,
.doc-body .nq-embed-preview-wrap--image > img {
  margin: 0;
}

.nq-embed-has-preview {
  position: relative;
}

.nq-embed-preview-btn {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 28px;
  height: 28px;
  padding: 5px;
  border: none;
  border-radius: 7px;
  background: var(--ac, #10a86a);
  color: #fff;
  cursor: pointer;
  z-index: 3;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .22);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: .92;
  transition: opacity .15s, background .15s;
}

.nq-embed-preview-btn svg {
  width: 14px;
  height: 14px;
  display: block;
}

.nq-embed-preview-btn:hover,
.nq-embed-preview-btn:focus {
  opacity: 1;
  background: #0d9460;
}

.nq-embed-preview-btn--floating {
  z-index: 6;
}

.nq-embed-preview-panel {
  background: var(--card, #fff);
  border-radius: 12px;
  width: 70vw;
  height: 70vh;
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 40px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.nq-embed-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line, rgba(0, 0, 0, .08));
  flex-shrink: 0;
}

.nq-embed-preview-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #15171c);
}

.nq-embed-preview-close {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--chip, rgba(0, 0, 0, .06));
  border-radius: 8px;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted, #3f454e);
}

.nq-embed-preview-close:hover {
  background: rgba(0, 0, 0, .1);
}

.nq-embed-preview-body {
  flex: 1;
  overflow: auto;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.nq-embed-preview-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.nq-embed-preview-table-wrap {
  width: 100%;
  align-self: flex-start;
}

.nq-embed-preview-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.nq-embed-preview-table-wrap th,
.nq-embed-preview-table-wrap td {
  border: 1px solid var(--line, rgba(0, 0, 0, .14));
  padding: 8px 10px;
  vertical-align: top;
}

.nq-embed-preview-table-wrap th {
  background: var(--chip, #f5f4f0);
  font-weight: 600;
}

.nq-embed-preview-body .ql-mermaid-source {
  display: none !important;
}

.nq-embed-preview-body .ql-chart {
  width: 100% !important;
  max-width: 100% !important;
  min-height: 320px;
  margin-left: auto !important;
  margin-right: auto !important;
  align-self: center;
}

.nq-embed-preview-body .ql-mermaid {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  align-self: center;
}

.nq-embed-preview-body .ql-mermaid-output {
  display: flex;
  justify-content: center;
}

.nq-embed-preview-body .ql-mermaid-output svg {
  max-width: 100%;
  height: auto;
  display: block;
}
