:root {
  --background: #050807;
  --text: #d8ecff;
  --muted: #8fa6b8;
  --accent: #7ccbff;
  --border: rgba(124, 203, 255, 0.25);
  --current: #7cff9b;
  --status-development: #ffb86c;
  --status-archived: #8fa6b8;
}

body[data-theme="light"] {
  --background: #f7fbff;
  --text: #10202d;
  --muted: #526879;
  --accent: #006fa8;
  --border: rgba(0, 111, 168, 0.24);
  --current: #1f9d55;
  --status-development: #ffb86c;
  --status-archived: #8fa6b8;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  overflow-y: scroll;
  scroll-behavior: smooth;
}

@media (pointer: fine) and (prefers-reduced-motion: no-preference) {
  *,
  *::before,
  *::after {
    cursor: none !important;
  }
}

body {
  font-family: "IBM Plex Mono", "Courier New", Courier, monospace;
  background-color: var(--background);
  background-image: radial-gradient(
    circle at center,
    rgba(80, 180, 255, 0.08),
    transparent 55%
  );
  background-size: cover;
  color: var(--text);
  color-scheme: dark;
  font-size: 14px;
  line-height: 1.6;
  letter-spacing: 0;
  margin: 0;
  min-height: 100vh;
}

body[data-theme="light"] {
  background-image: radial-gradient(
    circle at center,
    rgba(0, 111, 168, 0.1),
    transparent 55%
  );
  color-scheme: light;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(rgba(124, 203, 255, 0.035), transparent 2px);
  background-size: 100% 4px;
  background-position: 0 0;
  animation: breath 5s ease-in-out infinite;
  opacity: 1;
}

body[data-theme="light"]::before {
  background: linear-gradient(rgba(0, 111, 168, 0.06), transparent 2px);
}

@keyframes breath {
  0%,
  100% {
    opacity: 0;
  }

  50% {
    opacity: 1;
  }
}

h1,
h2,
h3 {
  font-family: "IBM Plex Mono", monospace;
  font-weight: 600;
  letter-spacing: 0;
  margin: 0;
  color: var(--text);
  text-transform: uppercase;
}

h1 {
  font-size: 2rem;
  line-height: 1;
}

.site-title-link {
  color: inherit;
  text-decoration: none;
}

h2 {
  font-size: 1.5rem;
  line-height: 1;
}

h3 {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  font-size: 1.25rem;
  line-height: 1.4;
}

.icon-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.link-icon {
  flex: 0 0 auto;
  width: 1.15em;
  height: 1.15em;
  fill: currentColor;
}

.external-link {
  display: inline-flex;
  align-items: center;
  color: var(--accent);
  font-size: 1rem;
  line-height: 1;
  text-decoration: none;
}

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

.external-link svg {
  width: 1em;
  height: 1em;
  fill: currentColor;
}

p {
  margin: 0;
}

ul {
  margin: 0;
  padding-left: 1.1rem;
}

li + li {
  margin-top: 6px;
}

.site-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(100% - 32px, 1280px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 64px 0;
}

.site-shell::before,
.content-section::before,
.site-footer::before {
  content: "";
  display: block;
  width: 72px;
  height: 1px;
  background: var(--accent);
  box-shadow: 0 0 14px rgba(124, 203, 255, 0.4);
}

.content-section::before,
.site-footer::before {
  margin-bottom: 14px;
}

.site-header {
  display: grid;
  grid-template-columns: minmax(max-content, 1fr) minmax(0, 3fr) minmax(
      max-content,
      1fr
    );
  align-items: center;
  gap: 48px;
}

.header-meta {
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.4;
  text-align: right;
  text-transform: uppercase;
  white-space: nowrap;
}

.header-meta time {
  color: var(--text);
}

.time-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  line-height: 1;
}

.time-status > span {
  width: 7px;
  height: 7px;
  background: var(--current);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(124, 255, 155, 0.65);
  animation: status-blink 2.5s ease-in-out infinite;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  vertical-align: middle;
  line-height: 1;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  color: #fff;
}

.theme-toggle-icon {
  display: block;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.theme-toggle-icon path {
  fill: currentColor;
}

.theme-toggle-moon {
  display: none;
}

body[data-theme="light"] .theme-toggle-sun {
  display: none;
}

body[data-theme="light"] .theme-toggle-moon {
  display: block;
}

body[data-theme="light"] .theme-toggle:hover,
body[data-theme="light"] .theme-toggle:focus-visible {
  color: #000;
}

@keyframes status-blink {
  0%,
  100% {
    opacity: 0.25;
  }

  50% {
    opacity: 1;
  }
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  min-width: 0;
  align-items: center;
  gap: 12px 48px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
}

.site-nav a,
.nav-menu-trigger {
  position: relative;
  display: inline-block;
  padding: 0;
  border: 0;
  appearance: none;
  background: transparent;
  color: inherit;
  font: inherit;
  text-decoration: none;
  text-transform: uppercase;
  transition:
    color 140ms ease,
    transform 140ms ease;
}

.site-nav a::before,
.nav-menu-trigger::before {
  content: ">";
  position: absolute;
  right: 100%;
  color: var(--accent);
  opacity: 0;
}

.nav-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
  color: inherit;
}

.nav-menu::after {
  content: "";
  position: absolute;
  top: 100%;
  right: -14px;
  left: -14px;
  height: 12px;
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: -14px;
  z-index: 30;
  display: grid;
  min-width: 112px;
  gap: 12px;
  padding: 6px 14px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition:
    opacity 140ms ease,
    transform 140ms ease,
    visibility 140ms ease;
  visibility: hidden;
}

.nav-dropdown a {
  width: max-content;
  max-width: 100%;
  font-size: 0.875rem;
  line-height: 1.2;
  white-space: nowrap;
}

.nav-menu.is-open .nav-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  visibility: visible;
}

@media (hover: hover) and (pointer: fine) {
  .nav-menu:hover .nav-dropdown {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    visibility: visible;
  }
}

.site-nav a:hover,
.site-nav a:focus-visible,
.nav-menu-trigger:hover,
.nav-menu-trigger:focus-visible,
.nav-menu.is-open .nav-menu-trigger {
  color: var(--text);
  transform: translateX(0.35rem);
}

.site-nav a:hover::before,
.site-nav a:focus-visible::before,
.nav-menu-trigger:hover::before,
.nav-menu-trigger:focus-visible::before,
.nav-menu.is-open .nav-menu-trigger::before {
  opacity: 1;
}

.site-nav:not(:hover):not(:focus-within) a.is-current,
.site-nav:not(:hover):not(:focus-within) .nav-menu-trigger.is-current {
  color: var(--text);
  transform: translateX(0.35rem);
}

.site-nav:not(:hover):not(:focus-within) a.is-current::before,
.site-nav:not(:hover):not(:focus-within) .nav-menu-trigger.is-current::before {
  opacity: 1;
}

@media (max-width: 900px) {
  .site-header {
    grid-template-columns: max-content minmax(0, 1fr) max-content;
    gap: 32px;
  }

  .site-nav {
    gap: 18px 32px;
  }
}

.intro-section {
  max-width: 100%;
  margin-top: 96px;
  color: var(--muted);
  font-size: 1rem;
}

.content-section {
  max-width: 100%;
  min-height: 220px;
  margin-top: 90px;
  scroll-margin-top: 64px;
}

.section-heading-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-heading-link {
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 140ms ease;
}

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

.education-section {
  min-height: auto;
  margin-top: 112px;
}

.site-footer {
  margin-top: auto;
  padding-top: 96px;
  color: var(--muted);
  font-size: 0.875rem;
  text-transform: uppercase;
}

.site-footer-row {
  display: flex;
  justify-content: space-between;
  gap: 24px;
}

.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10;
  color: var(--muted);
  font-size: 0.875rem;
  opacity: 0;
  pointer-events: none;
  text-decoration: none;
  text-transform: uppercase;
  transform: translateY(4px);
  transition:
    color 140ms ease,
    opacity 160ms ease,
    transform 160ms ease,
    visibility 160ms ease;
  visibility: hidden;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  visibility: visible;
}

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

.experience-list,
.project-list {
  display: grid;
  margin-top: 32px;
}

.experience-list {
  gap: 32px;
}

.experience-group {
  display: grid;
  gap: 20px;
}

.experience-item,
.project-item {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 32px;
  color: var(--muted);
}

.date-range {
  color: var(--accent);
  display: flex;
  flex-direction: column;
  font-size: 0.875rem;
  line-height: 1.6;
  white-space: nowrap;
}

.date-start {
  order: 3;
}

.date-separator {
  order: 2;
}

.date-end,
.date-note {
  order: 1;
}

.experience-role,
.project-role,
.education-major {
  color: var(--text);
  margin-top: 4px;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  margin-bottom: 0;
}

.education-name:has(+ ul),
.education-major:has(+ ul),
.experience-name:has(+ ul),
.experience-role:has(+ ul),
.project-name:has(+ ul),
.project-role:has(+ ul) {
  margin-bottom: 12px;
}

.experience-status,
.project-status {
  font-size: 0.875rem;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.experience-status {
  color: var(--current);
}

.experience-group .experience-item + .experience-item .experience-role {
  margin-top: 0;
}

.project-list {
  gap: 40px;
}

.status-development {
  color: var(--status-development);
}

.status-live {
  color: var(--current);
}

.status-archived {
  color: var(--status-archived);
}

.contact-table {
  width: 100%;
  max-width: 680px;
  margin-top: 32px;
  border-collapse: collapse;
  color: var(--muted);
}

.contact-table th,
.contact-table td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  text-align: left;
}

.contact-table th {
  color: var(--accent);
  font-weight: 500;
  text-transform: uppercase;
}

.contact-table a {
  color: var(--muted);
  text-decoration: none;
}

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

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.contact-link .link-icon {
  color: var(--accent);
  line-height: 1;
}

.contact-table td:first-child,
.contact-table td:last-child {
  text-transform: uppercase;
  white-space: nowrap;
}

@media (max-width: 800px) {
  body {
    font-size: 13px;
  }

  h1 {
    font-size: 1.5rem;
    line-height: 1.1;
  }

  h2 {
    font-size: 1.25rem;
  }

  h3 {
    font-size: 1.05rem;
  }

  .site-shell {
    width: min(100% - 20px, 1280px);
    padding: 32px 18px 64px;
  }

  .site-header {
    align-items: center;
    grid-template-columns: minmax(0, 1fr) max-content;
    gap: 22px;
  }

  .site-title {
    grid-column: 1;
    grid-row: 1;
  }

  .site-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    gap: 14px 24px;
    font-size: 0.875rem;
  }

  .nav-dropdown {
    min-width: min(112px, calc(100vw - 56px));
  }

  .header-meta {
    grid-column: 2;
    grid-row: 1;
    font-size: 0.75rem;
    text-align: right;
  }

  .intro-section {
    margin-top: 72px;
  }

  .content-section {
    min-height: auto;
    margin-top: 72px;
    scroll-margin-top: 32px;
  }

  .education-section {
    margin-top: 84px;
  }

  .experience-list,
  .project-list {
    gap: 28px;
    margin-top: 24px;
  }

  .experience-group {
    gap: 18px;
  }

  .experience-item,
  .project-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .date-range {
    display: inline-flex;
    flex-direction: row;
    gap: 0.35rem;
  }

  .date-start,
  .date-note {
    order: 1;
  }

  .date-separator {
    order: 2;
  }

  .date-end {
    order: 3;
  }

  .contact-table {
    display: block;
    max-width: 100%;
  }

  .contact-table thead {
    display: none;
  }

  .contact-table tbody,
  .contact-table tr,
  .contact-table td {
    display: block;
  }

  .contact-table tr {
    border: 1px solid var(--border);
  }

  .contact-table tr + tr {
    border-top: 0;
  }

  .contact-table th,
  .contact-table td {
    border: 0;
    padding: 8px;
  }

  .contact-table td:first-child {
    color: var(--accent);
    padding-bottom: 0;
  }

  .contact-table td:nth-child(2) {
    padding-top: 0;
    padding-bottom: 0;
    overflow-wrap: anywhere;
  }

  .contact-table td:last-child {
    padding-top: 0;
    font-size: 0.75rem;
  }

  .site-footer {
    padding-top: 72px;
  }

  .site-footer-row {
    align-items: flex-start;
    gap: 16px;
  }

  .back-to-top {
    right: 18px;
    bottom: 18px;
    font-size: 0.75rem;
  }
}

.cursor-ring,
.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  will-change: transform;
}

.cursor-ring {
  z-index: 100;
  width: 48px;
  height: 48px;
  border: 1.25px solid var(--accent);
  box-shadow: 0 0 14px rgba(124, 203, 255, 0.25);
  transition: opacity 160ms ease;
}

.cursor-dot {
  z-index: 101;
  width: 5px;
  height: 5px;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(124, 203, 255, 0.65);
  transition: opacity 120ms ease;
}

.cursor-active .cursor-ring,
.cursor-active .cursor-dot {
  opacity: 0.9;
}

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

  body::before,
  .time-status > span {
    animation: none;
  }

  body::before {
    opacity: 0.35;
  }

  .time-status > span {
    opacity: 1;
  }

  .site-nav a,
  .nav-menu-trigger,
  .nav-dropdown,
  .back-to-top,
  .cursor-ring,
  .cursor-dot {
    transition: none;
  }
}

::selection {
  background: var(--accent);
  color: var(--background);
}
