:root {
  --bg: #f7f8f5;
  --surface: #ffffff;
  --surface-strong: #eff4ef;
  --text: #18201d;
  --text-muted: #58635d;
  --border: #dce4dd;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --accent-soft: #d9efeb;
  --warn: #b45309;
  --shadow: 0 18px 44px rgba(20, 28, 25, 0.1);
  --radius: 8px;
  --max-width: 1120px;
  --header-height: 76px;
}

:root[data-theme="dark"] {
  --bg: #101418;
  --surface: #171d21;
  --surface-strong: #20272c;
  --text: #edf4ef;
  --text-muted: #a9b7b0;
  --border: #313b40;
  --accent: #4fd1c5;
  --accent-strong: #8ae6dd;
  --accent-soft: #183633;
  --warn: #f6ad55;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 24px);
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--accent-soft) 70%, transparent), transparent 32rem),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration-color: color-mix(in srgb, var(--accent) 70%, transparent);
  text-underline-offset: 0.2em;
}

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

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: 1rem;
  z-index: 100;
  transform: translateY(-160%);
  border-radius: var(--radius);
  background: var(--text);
  color: var(--bg);
  padding: 0.75rem 1rem;
  font-weight: 700;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: var(--header-height);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(18px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(100% - 2rem, var(--max-width));
  min-height: var(--header-height);
  margin: 0 auto;
}

.brand,
.nav-links,
.hero-actions,
.ops-panel-header,
.contact-list,
.theme-toggle {
  display: flex;
  align-items: center;
}

.brand {
  gap: 0.7rem;
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 2.4rem;
  height: 2.4rem;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--accent-strong);
  font-size: 0.82rem;
  letter-spacing: 0;
  box-shadow: var(--shadow);
}

.brand-text {
  white-space: nowrap;
}

.nav-links {
  gap: 1.1rem;
  font-size: 0.94rem;
  color: var(--text-muted);
}

.nav-links a {
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--text);
}

.theme-toggle {
  gap: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  padding: 0.55rem 0.75rem;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.theme-toggle-icon {
  width: 0.9rem;
  height: 0.9rem;
  border: 2px solid currentColor;
  border-radius: 50%;
  box-shadow: inset -4px -4px 0 0 currentColor;
}

.section {
  width: min(100% - 2rem, var(--max-width));
  margin: 0 auto;
  padding: 5.5rem 0;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(320px, 0.8fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 5rem);
  min-height: calc(100svh - var(--header-height));
  padding-top: 4rem;
  padding-bottom: 4rem;
}

.location,
.section-label {
  margin: 0 0 0.7rem;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.12;
  letter-spacing: 0;
}

h1 {
  max-width: 12ch;
  font-size: 6.35rem;
}

h2 {
  font-size: 3.35rem;
}

h3 {
  font-size: 1.08rem;
}

.hero-title {
  max-width: 720px;
  margin: 1.1rem 0 0;
  color: var(--text);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.4;
}

.hero-intro {
  max-width: 690px;
  margin: 1.2rem 0 0;
  color: var(--text-muted);
  font-size: 1.12rem;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.85rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.1;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button.primary {
  background: var(--accent);
  color: #061311;
}

:root[data-theme="light"] .button.primary,
:root:not([data-theme]) .button.primary {
  color: #ffffff;
}

.button.secondary {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}

.button.ghost {
  border-color: transparent;
  color: var(--text-muted);
}

.hero-visual {
  position: relative;
}

.ops-panel {
  position: relative;
  min-height: 420px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface-strong) 80%, transparent), transparent),
    var(--surface);
  box-shadow: var(--shadow);
}

.ops-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(color-mix(in srgb, var(--border) 55%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--border) 55%, transparent) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
  opacity: 0.42;
}

.ops-panel-header {
  position: relative;
  z-index: 2;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding: 1rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.ops-grid {
  position: relative;
  z-index: 2;
  display: grid;
  min-height: 340px;
  padding: 1.25rem;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.ops-node {
  align-self: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 91%, transparent);
  padding: 1rem;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.08);
}

.node-cloud,
.node-network {
  justify-self: start;
}

.node-endpoint,
.node-service {
  justify-self: end;
}

.node-label,
.node-detail {
  display: block;
}

.node-label {
  font-weight: 850;
}

.node-detail {
  margin-top: 0.25rem;
  color: var(--text-muted);
  font-size: 0.84rem;
}

.ops-lines {
  position: absolute;
  inset: 3rem 1rem 1rem;
  width: calc(100% - 2rem);
  height: calc(100% - 4rem);
  color: var(--accent);
  pointer-events: none;
}

.ops-lines path,
.ops-lines circle {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  opacity: 0.55;
}

.ops-lines circle {
  fill: currentColor;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(280px, 1fr);
  gap: clamp(2rem, 7vw, 6rem);
  border-top: 1px solid var(--border);
}

.section-heading.narrow {
  max-width: 780px;
}

.section-copy p,
.section-heading p,
.project-card p {
  color: var(--text-muted);
}

.section-copy p:first-child,
.section-heading p:first-of-type:not(.section-label) {
  margin-top: 0;
}

.section-copy p:last-child,
.section-heading p:last-child {
  margin-bottom: 0;
}

.card-grid {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
}

.skills-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.project-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card,
.snapshot-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.06);
}

.card {
  padding: 1.15rem;
}

.skill-card {
  min-height: 250px;
}

.skill-card h3,
.project-card h3 {
  margin-bottom: 0.9rem;
}

.skill-card ul,
.snapshot-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.skill-card li {
  position: relative;
  padding: 0.38rem 0 0.38rem 1rem;
  color: var(--text-muted);
  font-size: 0.94rem;
}

.skill-card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1rem;
  width: 0.36rem;
  height: 0.36rem;
  border-radius: 50%;
  background: var(--accent);
}

.project-card {
  min-height: 205px;
  border-top: 3px solid color-mix(in srgb, var(--accent) 72%, var(--warn));
}

.project-card p {
  margin: 0;
}

.snapshot-section {
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.snapshot-card {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(300px, 1fr);
  gap: 2rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent-soft) 58%, transparent), transparent 68%),
    var(--surface);
}

.snapshot-list {
  display: grid;
  gap: 0.8rem;
}

.snapshot-list li {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  color: var(--text-muted);
}

.resume-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 2rem;
}

code {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-strong);
  padding: 0.1rem 0.35rem;
  color: var(--text);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
}

.contact-section {
  padding-top: 3rem;
}

.contact-list {
  flex-direction: column;
  align-items: stretch;
  gap: 0.8rem;
  max-width: 760px;
  margin-top: 2rem;
}

.contact-item {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  gap: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1rem;
  text-decoration: none;
}

.contact-item span {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.contact-item strong {
  font-weight: 750;
  overflow-wrap: anywhere;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1rem;
  color: var(--text-muted);
  text-align: center;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 980px) {
  .nav {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 0.9rem 0;
  }

  .nav-links {
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 0.2rem;
  }

  .hero,
  .split-section,
  .snapshot-card,
  .resume-section {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .skills-grid,
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  h1 {
    font-size: 4.75rem;
  }

  h2 {
    font-size: 2.55rem;
  }

  .hero-title {
    font-size: 1.15rem;
  }

  .resume-section {
    align-items: start;
  }
}

@media (max-width: 680px) {
  :root {
    --header-height: 116px;
  }

  body {
    background:
      radial-gradient(circle at top left, color-mix(in srgb, var(--accent-soft) 80%, transparent), transparent 22rem),
      var(--bg);
  }

  .section {
    width: min(100% - 1.25rem, var(--max-width));
    padding: 3.4rem 0;
  }

  .brand-text,
  .theme-toggle-text {
    display: none;
  }

  .nav-links {
    gap: 0.9rem;
    font-size: 0.88rem;
  }

  h1 {
    font-size: 3.55rem;
  }

  h2 {
    font-size: 2.08rem;
  }

  .hero-title,
  .hero-intro {
    font-size: 1rem;
  }

  .hero-actions,
  .button {
    width: 100%;
  }

  .ops-panel {
    min-height: auto;
  }

  .ops-grid {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .ops-node {
    justify-self: stretch;
  }

  .ops-lines {
    display: none;
  }

  .skills-grid,
  .project-grid {
    grid-template-columns: 1fr;
  }

  .skill-card,
  .project-card {
    min-height: auto;
  }

  .contact-item {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }
}

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

  .button {
    transition: none;
  }
}

@media print {
  :root,
  :root[data-theme="dark"] {
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-strong: #f3f5f4;
    --text: #111111;
    --text-muted: #444444;
    --border: #cccccc;
    --accent: #0f5f59;
    --accent-strong: #0f5f59;
    --shadow: none;
  }

  html {
    scroll-behavior: auto;
  }

  body {
    background: #ffffff;
    font-size: 11pt;
  }

  .site-header,
  .hero-visual,
  .theme-toggle,
  .skip-link,
  .site-footer {
    display: none;
  }

  .section,
  .hero {
    width: 100%;
    padding: 0.35in 0;
  }

  .hero,
  .split-section,
  .skills-grid,
  .project-grid,
  .snapshot-card,
  .resume-section {
    display: block;
  }

  .card,
  .snapshot-card {
    break-inside: avoid;
    border: 1px solid #cccccc;
    box-shadow: none;
    margin: 0 0 0.15in;
  }

  a {
    color: #111111;
    text-decoration: none;
  }

  .button {
    border: 0;
    padding: 0;
    display: inline;
  }
}
