@import url("https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600&display=swap");

:root {
  --bg: #111111;
  --text: #e8e8e8;
  --muted: #9a9a9a;
  --link-hover: #c4c4c4;
  --underline: rgba(154, 154, 154, 0.45);
  --underline-hover: rgba(232, 232, 232, 0.55);
  --underline-thickness: 0.5px;
  /* Fixed layout — no viewport-based scaling */
  --max: 40rem;
  --pad-x: 1.5rem;
  --pad-y: 3.5rem;
  /* Top offset to first heading: 48px below 640px, 96px from 640px up (Tailwind sm) */
  --pad-top: 3rem;
  --space-section: 3.25rem;
  --space-after-heading: 1.125rem;
  --space-name-to-bio: 1.5rem;
  --space-paragraph: 1rem;
  --space-project: 1.5rem;
  /* Type scale (root 16px): 18 / 16 / 14 */
  --fs-heading: 1.125rem; /* 18px — name, Projects, Connect, blog page title */
  --fs-body: 1rem; /* 16px — body, role, intro paragraphs, connect links, project titles */
  --fs-role: 1rem; /* 16px — “Network engineer” */
  --fs-project-title: 1rem; /* 16px — Project One / Two / Three */
  --fs-project-desc: 0.875rem; /* 14px — “Coming soon.” */
  --lh-body: 1.7;
  --lh-tight: 1.45;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--muted);
  font-family: "Fira Code", ui-monospace, monospace;
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (min-width: 640px) {
  :root {
    --pad-top: 6rem;
  }
}

.page {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: var(--pad-top) var(--pad-x) 6rem; /* 96px to bottom of viewport */
}

.icon-external {
  display: inline-block;
  width: 0.78em;
  height: 0.78em;
  vertical-align: -0.14em;
  flex-shrink: 0;
  pointer-events: none;
}

.text-link__mark .icon-external {
  margin-left: 0;
}

.display-heading {
  margin: 0;
  font-size: var(--fs-heading);
  font-weight: 600;
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
  color: var(--text);
}

.intro {
  margin-bottom: var(--space-section);
}

.intro-role {
  margin: 0.5rem 0 0;
  font-size: var(--fs-role);
  line-height: var(--lh-tight);
  color: var(--muted);
}

.intro-body {
  margin-top: var(--space-name-to-bio);
  display: flex;
  flex-direction: column;
  gap: var(--space-paragraph);
}

.intro-body p {
  margin: 0;
}

.intro-cta {
  margin-top: 0.25rem;
}

.block {
  margin-bottom: var(--space-section);
}

.block:last-child {
  margin-bottom: 0;
}

.block .display-heading {
  margin-bottom: var(--space-after-heading);
}

.project-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-project);
}

.project {
  margin: 0;
}

/* Inline (not flex): inline-flex can paint underline across the whole row including the icon */
.project-name {
  display: inline;
  font-size: var(--fs-project-title);
  font-weight: 500;
  line-height: var(--lh-tight);
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s ease;
}

.project-name .icon-external {
  margin-left: 0.35em;
  vertical-align: -0.14em;
}

.project-name__text {
  text-decoration: underline;
  text-decoration-color: var(--underline);
  text-decoration-thickness: var(--underline-thickness);
  text-underline-offset: 5px;
  text-decoration-skip-ink: auto;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.project-name:hover .project-name__text,
.project-name:focus-visible .project-name__text {
  text-decoration-color: var(--underline-hover);
}

.project-name:hover,
.project-name:focus-visible {
  color: var(--link-hover);
}

.project-blurb {
  margin: 0.25rem 0 0;
  font-size: var(--fs-project-desc);
  line-height: var(--lh-tight);
  color: var(--muted);
}

.text-link {
  text-decoration: none;
  color: var(--muted);
  transition: color 0.15s ease;
}

.text-link:hover,
.text-link:focus-visible {
  color: var(--text);
}

.text-link__mark {
  display: inline-flex;
  align-items: center;
  gap: 0.28em;
}

.text-link__word {
  text-decoration: underline;
  text-decoration-color: currentColor;
  text-decoration-thickness: var(--underline-thickness);
  text-underline-offset: 5px;
  text-decoration-skip-ink: auto;
  transition: color 0.15s ease;
}

.contact-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.5rem;
}

.contact-row a {
  font-size: var(--fs-body);
}

.contact-link {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.blog-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.blog-link__text,
.contact-link__text {
  text-decoration: underline;
  text-decoration-color: var(--underline);
  text-decoration-thickness: var(--underline-thickness);
  text-underline-offset: 5px;
  text-decoration-skip-ink: auto;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.blog-link:hover,
.blog-link:focus-visible,
.contact-link:hover,
.contact-link:focus-visible {
  color: var(--text);
}

.blog-link:hover .blog-link__text,
.blog-link:focus-visible .blog-link__text,
.contact-link:hover .contact-link__text,
.contact-link:focus-visible .contact-link__text {
  text-decoration-color: var(--underline-hover);
}

.blog-link .icon-external {
  margin-left: 0;
}

a:focus-visible {
  outline: 1px solid var(--muted);
  outline-offset: 3px;
}

.project-name:focus-visible {
  outline-offset: 2px;
}

/* Blog page */
.page--blog .intro-body {
  margin-top: 0;
}

.back-link {
  display: inline-block;
  margin-bottom: var(--space-section);
  color: var(--muted);
  text-decoration: none;
  font-size: var(--fs-body);
  transition: color 0.15s ease;
}

.back-link:hover,
.back-link:focus-visible {
  color: var(--text);
}

.body-text {
  margin: 0 0 var(--space-paragraph);
  color: var(--muted);
}

.body-text:last-child {
  margin-bottom: 0;
}

.coming-soon {
  color: var(--text);
}

.blog-coming-soon .section-title {
  margin-bottom: var(--space-after-heading);
}

.section-title {
  font-size: var(--fs-heading);
  font-weight: 600;
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 var(--space-after-heading);
}

::selection {
  background: #2a2a2a;
  color: var(--text);
}
