:root {
  --bg: #0b0d0f;
  --bg-raised: #101316;
  --surface: #13171a;
  --surface-hover: #171c1f;
  --text: #c9ced2;
  --text-strong: #f2f4f5;
  --text-muted: #8e989f;
  --accent: #72c992;
  --accent-strong: #91d8aa;
  --accent-soft: rgba(114, 201, 146, 0.09);
  --border: #252b2f;
  --border-strong: #343c41;

  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Consolas, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  max-width: 1240px;
  margin: 0 auto;
  padding: 2.4rem 1.6rem 3rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent 220px),
    var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgba(114, 201, 146, 0.35);
  color: var(--text-strong);
}

h1,
h2,
h3 {
  color: var(--text-strong);
}

h1 {
  font-family: var(--font-mono);
  font-size: clamp(2.15rem, 4vw, 3.15rem);
  line-height: 1.04;
  letter-spacing: -0.045em;
  font-weight: 700;
}

h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 3.4rem;
  margin-bottom: 1.45rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h2::before {
  content: '> ';
  flex: 0 0 auto;
  color: var(--accent);
}

h3 {
  font-family: var(--font-mono);
  font-size: 1.02rem;
  line-height: 1.45;
  font-weight: 600;
}

p {
  margin-bottom: 1.1rem;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition:
    color 150ms ease,
    border-color 150ms ease,
    background-color 150ms ease,
    transform 150ms ease;
}

a:hover {
  color: var(--accent-strong);
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 3px;
}

code,
pre {
  font-family: var(--font-mono);
}

code {
  color: #d8dedf;
  font-size: 0.9em;
}

.site-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    'info nav'
    'info contacts';
  align-items: end;
  gap: 1rem 2rem;
  margin-bottom: 4rem;
  padding: 0.4rem 0 1.6rem;
  border-bottom: 1px solid var(--border);
}

.header-info {
  grid-area: info;
}

.header-info h1 {
  margin-bottom: 0.62rem;
}

.role {
  margin: 0;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.015em;
}

.role::before {
  content: '> ';
  color: var(--accent);
}

.page-navigation {
  grid-area: nav;
  justify-self: end;
}

a.btn-projects-highlight {
  display: inline-flex;
  align-items: center;
  min-height: 39px;
  padding: 0.55rem 0.82rem;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: transparent;
  color: var(--text-strong);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
}

a.btn-projects-highlight:hover {
  border-color: rgba(114, 201, 146, 0.62);
  background: var(--accent-soft);
  color: var(--accent-strong);
  transform: translateY(-1px);
}

.contact-links {
  grid-area: contacts;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem 0.95rem;
  font-size: 0.79rem;
}

.contact-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 35px;
  padding: 0.4rem 0.62rem;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  text-decoration: none;
}

.contact-links a:hover {
  border-color: rgba(114, 201, 146, 0.62);
  background: var(--accent-soft);
  color: var(--accent-strong);
  transform: translateY(-1px);
}

.contact-links svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.contact-links .btn-download {
  color: var(--accent);
}

.main-layout {
  display: grid;
  grid-template-columns: minmax(255px, 315px) minmax(0, 1fr);
  gap: clamp(3rem, 7vw, 5.5rem);
  align-items: start;
}

.profile-section {
  padding-bottom: 1.55rem;
  border-bottom: 1px solid var(--border);
}

.sidebar > section:not(.profile-section) {
  margin-top: 2.5rem;
}

.profile-picture-container {
  margin-bottom: 1.25rem;
}

.profile-picture-frame {
  width: 100%;
  max-width: 285px;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: var(--surface);
}

.profile-picture-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-intro-text {
  margin: 0;
  color: #bcc3c7;
  font-size: 0.95rem;
}

.profile-intro-text::before {
  content: '// ';
  color: var(--accent);
  font-family: var(--font-mono);
}

.profile-facts {
  display: grid;
  gap: 0.52rem;
  margin-top: 1.35rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--border);
}

.profile-facts div {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 0.75rem;
}

.profile-facts dt {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.profile-facts dd {
  color: #c4cace;
  font-size: 0.82rem;
}

.primary-content > section:first-child h2,
.sidebar > section:first-child + section h2 {
  margin-top: 0;
}

.section-intro {
  max-width: 720px;
  color: #b9c0c4;
}

.large-intro {
  max-width: 850px;
  margin-bottom: 0;
  color: #c5cbce;
  font-size: clamp(1.03rem, 2vw, 1.22rem);
  line-height: 1.8;
}

.stack-category {
  margin-bottom: 1.45rem;
}

.stack-category:last-child {
  margin-bottom: 0;
}

.stack-category h3 {
  margin-bottom: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stack-tags,
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.46rem;
}

.tag {
  display: inline-block;
  padding: 0.3rem 0.58rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.012);
  color: #c5cbcf;
  font-family: var(--font-mono);
  font-size: 0.69rem;
  line-height: 1.4;
}

.focus-list {
  border-top: 1px solid var(--border);
}

.focus-list article {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 1rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}

.focus-number {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

.focus-list h3 {
  margin-bottom: 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.92rem;
}

.focus-list p {
  margin: 0;
  color: #b9c0c4;
  font-size: 0.92rem;
}

.timeline {
  border-top: 1px solid var(--border);
}

.job {
  position: relative;
  padding: 1.55rem 0 1.65rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.job::before {
  content: '';
  position: absolute;
  top: 1.78rem;
  left: 0;
  width: 3px;
  height: 1.15rem;
  border-radius: 2px;
  background: var(--border-strong);
  transition: background-color 150ms ease;
}

.job:hover::before {
  background: var(--accent);
}

.job-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem 1.25rem;
  align-items: baseline;
  margin-bottom: 0.85rem;
}

.job-header h3 {
  font-family: var(--font-mono);
  font-size: 0.96rem;
}

.company,
.company a {
  color: var(--text-muted);
  font-weight: 400;
}

.company a:hover {
  color: var(--accent-strong);
}

.date {
  align-self: start;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  white-space: nowrap;
}

.date::before {
  content: '[ ';
}

.date::after {
  content: ' ]';
}

.job ul,
.plain-list {
  padding-left: 1.05rem;
  color: #bec5c9;
}

.job li,
.plain-list li {
  margin-bottom: 0.44rem;
  padding-left: 0.12rem;
  font-size: 0.93rem;
}

.job li:last-child,
.plain-list li:last-child {
  margin-bottom: 0;
}

.job li::marker,
.plain-list li::marker {
  color: #667077;
}

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

.certification-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 0.9rem;
  align-items: center;
  padding: 0.9rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: transparent;
  color: inherit;
  text-decoration: none;
}

.certification-item:hover {
  border-color: rgba(114, 201, 146, 0.62);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.cert-icon {
  display: flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
}

.cert-icon svg,
.cert-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cert-icon img {
  filter: invert(1) brightness(2);
}

.cert-details {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0.12rem;
}

.cert-id {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.cert-name {
  color: var(--text-strong);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.45;
}

.section-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3.4rem;
  margin-bottom: 1.45rem;
}

.section-heading-row h2 {
  margin: 0;
}

.text-link {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-decoration: none;
}

.text-link:hover {
  color: var(--accent-strong);
}

.selected-work-list {
  border-top: 1px solid var(--border);
}

.selected-work-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.25rem;
  align-items: center;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
  color: inherit;
  text-decoration: none;
}

.selected-work-item:hover {
  padding-left: 0.5rem;
  color: inherit;
}

.selected-work-item > span {
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.selected-work-item:hover > span {
  color: var(--accent);
}

.selected-work-item h3 {
  margin: 0.12rem 0 0.28rem;
  font-family: var(--font-mono);
  font-size: 0.94rem;
}

.selected-work-item p {
  margin: 0;
  color: #aeb6bb;
  font-size: 0.88rem;
}

.project-kicker,
.architecture-title {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.off-the-clock {
  margin-top: 4rem;
}

.projects-page {
  max-width: 1040px;
  margin: 0 auto;
}

.projects-intro h2 {
  margin-top: 0;
}

.case-study {
  scroll-margin-top: 1.5rem;
  margin-top: 5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-strong);
}

.case-study-header {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: flex-start;
  margin-bottom: 1.05rem;
}

.case-study-header h2 {
  margin: 0.45rem 0 0;
  font-size: clamp(1rem, 2vw, 1.18rem);
  letter-spacing: 0.06em;
}

.status-label {
  flex: 0 0 auto;
  padding: 0.28rem 0.48rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  white-space: nowrap;
}

.case-study-summary {
  max-width: 800px;
  margin-bottom: 1.25rem;
  color: #c2c8cb;
  font-size: 1.03rem;
}

.project-tags {
  margin-bottom: 2rem;
}

.case-study-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.78fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.case-study-copy h3 {
  margin: 1.7rem 0 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.case-study-copy h3:first-child {
  margin-top: 0;
}

.case-study-copy p,
.case-study-copy li {
  color: #b9c0c4;
}

.architecture-block,
.project-note {
  padding: 1.1rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.012);
}

.architecture-block pre {
  overflow-x: auto;
  margin-top: 1rem;
  color: #c7cecf;
  font-size: 0.75rem;
  line-height: 1.8;
}

.project-note p {
  color: #aeb7bb;
  font-size: 0.88rem;
}

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

.mono-note {
  margin-top: 0.9rem;
  padding: 0.72rem;
  overflow-wrap: anywhere;
  border-left: 2px solid var(--accent);
  background: rgba(114, 201, 146, 0.05);
  color: #d2d8da !important;
  font-family: var(--font-mono);
  font-size: 0.72rem !important;
}

.learning-section {
  margin-top: 5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-strong);
}

.learning-section h2 {
  margin-top: 0;
}

.learning-list {
  display: grid;
  gap: 0.55rem;
  margin-top: 1.6rem;
}

.learning-list > .learning-item {
  display: grid;
  grid-template-columns: 100px 34px minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  padding: 0.9rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: transparent;
  color: inherit;
  text-decoration: none;
}

.learning-list > .learning-item:hover {
  border-color: rgba(114, 201, 146, 0.62);
  background: var(--accent-soft);
  color: inherit;
  transform: translateY(-1px);
}

.learning-date {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

.learning-logo {
  display: flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
}

.learning-logo svg,
.learning-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.learning-logo-bcs img {
  filter: invert(1) brightness(2);
}

.learning-details {
  min-width: 0;
}

.learning-list h3 {
  margin-bottom: 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.88rem;
}

.learning-list p {
  margin: 0;
  color: #adb5b9;
  font-size: 0.88rem;
}

footer {
  margin-top: 5rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-align: center;
}

footer p {
  margin: 0;
}

@media (max-width: 900px) {
  body {
    padding: 1.4rem 1rem 2.2rem;
  }

  .site-header {
    grid-template-columns: 1fr;
    grid-template-areas:
      'info'
      'nav'
      'contacts';
    justify-items: start;
    align-items: start;
    margin-bottom: 3rem;
  }

  .page-navigation,
  .contact-links {
    justify-self: start;
    justify-content: flex-start;
  }

  .main-layout {
    display: flex;
    flex-direction: column;
    gap: 3.5rem;
  }

  .sidebar,
  .primary-content {
    display: contents;
  }

  .profile-section {
    order: 1;
  }

  .work-summary {
    order: 2;
  }

  .experience-section {
    order: 3;
  }

  .selected-work {
    order: 4;
  }

  .tools-section {
    order: 5;
  }

  #certifications {
    order: 6;
  }

  .off-the-clock {
    order: 7;
  }

  .sidebar > section:not(.profile-section),
  .off-the-clock,
  .section-heading-row {
    margin-top: 0;
  }

  .work-summary h2,
  .experience-section h2,
  .tools-section h2,
  #certifications h2,
  .off-the-clock h2 {
    margin-top: 0;
  }

  .profile-picture-frame {
    max-width: 240px;
  }

  .case-study-grid {
    grid-template-columns: 1fr;
  }

  .architecture-block,
  .project-note {
    max-width: 620px;
  }
}

@media (max-width: 620px) {
  h1 {
    font-size: 2rem;
  }

  .job-header {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }

  .date {
    justify-self: start;
    white-space: normal;
  }

  .contact-links {
    gap: 0.35rem 0.8rem;
  }

  .job {
    padding-left: 1rem;
  }

  .section-heading-row,
  .case-study-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .selected-work-item {
    grid-template-columns: 1fr auto;
  }

  .learning-list > .learning-item {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 0.5rem 0.85rem;
  }

  .learning-date {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}


.error-page {
  width: min(620px, 100%);
  margin: clamp(4rem, 14vh, 9rem) auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-strong);
}

.error-page .error-code {
  margin-bottom: 0.8rem;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.error-page h1 {
  margin-bottom: 1rem;
}

.error-page > p:not(.error-code) {
  max-width: 540px;
  margin-bottom: 1.6rem;
  color: var(--text-muted);
}


.architecture-caption {
  margin: 1rem 0 0;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.6;
}


.network-layout-block pre {
  white-space: pre;
  font-size: 0.72rem;
  line-height: 1.72;
}

.network-layout-block .architecture-caption {
  font-size: 0.84rem;
  line-height: 1.65;
}

@media (max-width: 900px) {
  .network-layout-block pre {
    white-space: pre-wrap;
    font-size: 0.72rem;
  }
}


.homelab-grid {
  grid-template-columns: minmax(0, 1.18fr) minmax(360px, 1fr);
  gap: clamp(1.8rem, 4vw, 3rem);
}

.homelab-grid .network-layout-block {
  padding: 1.2rem 1.25rem;
}

.homelab-grid .network-layout-block pre {
  font-size: 0.73rem;
  line-height: 1.72;
}

@media (max-width: 1180px) {
  .homelab-grid {
    grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.94fr);
  }
}


.footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1rem;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.28rem 0.52rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  line-height: 1;
  text-decoration: none;
}

.footer-link:hover {
  border-color: rgba(114, 201, 146, 0.62);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.privacy-page {
  width: min(780px, 100%);
  margin: 0 auto;
}

.privacy-intro h2 {
  margin-top: 0.55rem;
}

.privacy-section {
  margin-top: 3.5rem;
  padding-top: 0.2rem;
}

.privacy-section h2 {
  margin-top: 0;
}

.privacy-section p {
  color: #b9c0c4;
}

.privacy-control {
  margin-top: 1.5rem;
  padding: 1.1rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.012);
}

.privacy-control h3 {
  margin-bottom: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.privacy-control-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 1rem 0 0.8rem;
}

.privacy-button {
  min-height: 38px;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: transparent;
  color: var(--text-strong);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
}

.privacy-button:hover {
  border-color: rgba(114, 201, 146, 0.62);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.privacy-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.privacy-control-note {
  margin-bottom: 0 !important;
  color: var(--text-muted) !important;
  font-size: 0.78rem;
}

.privacy-sources {
  border-top: 1px solid var(--border);
}

@media (max-width: 620px) {
  .footer-inner {
    flex-direction: column;
  }

  .privacy-control-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .privacy-button {
    width: 100%;
  }
}


/* Keep the wider desktop homelab layout from overriding the mobile stack. */
@media (max-width: 900px) {
  .projects-page,
  .case-study,
  .case-study-grid,
  .case-study-copy,
  .architecture-block,
  .project-note {
    min-width: 0;
  }

  .homelab-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
  }

  .homelab-grid .network-layout-block {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 1rem;
    overflow: hidden;
  }

  .homelab-grid .network-layout-block pre {
    width: 100%;
    max-width: 100%;
    margin-top: 0.9rem;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: pre;
    font-size: 0.66rem;
    line-height: 1.65;
    -webkit-overflow-scrolling: touch;
  }

  .homelab-grid .network-layout-block code {
    display: block;
    width: max-content;
    min-width: 100%;
  }

  .homelab-grid .architecture-caption {
    overflow-wrap: anywhere;
  }
}

@media (max-width: 430px) {
  .homelab-grid .network-layout-block pre {
    font-size: 0.62rem;
  }
}
